1188 changed files with 235432 additions and 0 deletions
-
3.gitignore
-
6PC_104.vpw
-
599PC_104.vpwhist
-
BINPC_104.vtg
-
2PC_104/BOARDSN.HEX
-
BINPC_104/DMP_Vortex86_Series_Software_Programming_Reference_091216.pdf
-
BINPC_104/Debug/CWSDPMI.EXE
-
BINPC_104/Debug/CWSDPR0.EXE
-
BINPC_104/Debug/CWSDSTR0.EXE
-
BINPC_104/Debug/CWSDSTUB.EXE
-
BINPC_104/Debug/CWSPARAM.EXE
-
BINPC_104/Debug/PMODETSR.EXE
-
BINPC_104/Debug/PMODSTUB.EXE
-
196PC_104/Debug/cwsdpmi.doc
-
103PC_104/Debug/cwsparam.doc
-
85PC_104/LgLib/Advantech/LgAdvantechDeviceEnumerator.cpp
-
43PC_104/LgLib/Advantech/LgAdvantechDeviceEnumerator.h
-
346PC_104/LgLib/Advantech/LgAdvantechPCI1762.cpp
-
93PC_104/LgLib/Advantech/LgAdvantechPCI1762.h
-
125PC_104/LgLib/Advantech/LgLibAdvantech.dsp
-
46PC_104/LgLib/Advantech/LgLibAdvantech.plg
-
273PC_104/LgLib/Advantech/LgLibAdvantech.vcproj
-
65PC_104/LgLib/Advantech/LgLibAdvantech.vcproj.DUALCORE.Sergey.user
-
65PC_104/LgLib/Advantech/LgLibAdvantech.vcproj.P2600HT.Sergey.user
-
150PC_104/LgLib/Advantech/LgLibAdvantech.vcproj.old
-
10PC_104/LgLib/Advantech/LgLibAdvantech.vcproj.vspscc
-
152PC_104/LgLib/Advantech/LgLibAdvantech.vcxproj
-
41PC_104/LgLib/Advantech/LgLibAdvantech.vcxproj.filters
-
3PC_104/LgLib/Advantech/LgLibAdvantech.vcxproj.user
-
19PC_104/LgLib/Advantech/StdAfx.cpp
-
30PC_104/LgLib/Advantech/StdAfx.h
-
BINPC_104/LgLib/Advantech/adsapi/ADSIODriver.dll
-
BINPC_104/LgLib/Advantech/adsapi/UniReg.dll
-
BINPC_104/LgLib/Advantech/adsapi/adsapi32.dll
-
BINPC_104/LgLib/Advantech/adsapi/adsapi32.lib
-
BINPC_104/LgLib/Advantech/adsapi/adscomm.dll
-
232PC_104/LgLib/Advantech/adsapi/include/.svn/entries
-
5PC_104/LgLib/Advantech/adsapi/include/.svn/prop-base/vssver.scc.svn-base
-
37PC_104/LgLib/Advantech/adsapi/include/.svn/text-base/comm.h.svn-base
-
255PC_104/LgLib/Advantech/adsapi/include/.svn/text-base/device.h.svn-base
-
197PC_104/LgLib/Advantech/adsapi/include/.svn/text-base/dnet.h.svn-base
-
2042PC_104/LgLib/Advantech/adsapi/include/.svn/text-base/driver.h.svn-base
-
21PC_104/LgLib/Advantech/adsapi/include/.svn/text-base/os.h.svn-base
-
BINPC_104/LgLib/Advantech/adsapi/include/.svn/text-base/vssver.scc.svn-base
-
37PC_104/LgLib/Advantech/adsapi/include/comm.h
-
255PC_104/LgLib/Advantech/adsapi/include/device.h
-
197PC_104/LgLib/Advantech/adsapi/include/dnet.h
-
2042PC_104/LgLib/Advantech/adsapi/include/driver.h
-
21PC_104/LgLib/Advantech/adsapi/include/os.h
-
BINPC_104/LgLib/Advantech/adsapi/include/vssver.scc
-
BINPC_104/LgLib/Advantech/adsapi/vssver.scc
-
9PC_104/LgLib/Advantech/mssccprj.scc
-
BINPC_104/LgLib/Advantech/vssver.scc
-
420PC_104/LgLib/Comm/CLDm.h
-
420PC_104/LgLib/Comm/CRFm.h
-
32PC_104/LgLib/Comm/Connect.h
-
450PC_104/LgLib/Comm/Copy of PTZFlir.h
-
471PC_104/LgLib/Comm/Hebron.h
-
2379PC_104/LgLib/Comm/LGSM.H.bak
-
250PC_104/LgLib/Comm/LgLibComm.dsp
-
47PC_104/LgLib/Comm/LgLibComm.plg
-
533PC_104/LgLib/Comm/LgLibComm.vcproj
-
65PC_104/LgLib/Comm/LgLibComm.vcproj.DUALCORE.Sergey.user
-
65PC_104/LgLib/Comm/LgLibComm.vcproj.P2600HT.Sergey.user
-
204PC_104/LgLib/Comm/LgLibComm.vcproj.old
-
10PC_104/LgLib/Comm/LgLibComm.vcproj.vspscc
-
182PC_104/LgLib/Comm/LgLibComm.vcxproj
-
134PC_104/LgLib/Comm/LgLibComm.vcxproj.filters
-
3PC_104/LgLib/Comm/LgLibComm.vcxproj.user
-
470PC_104/LgLib/Comm/MIC1300m.h
-
466PC_104/LgLib/Comm/MIC1300m.h.bak
-
213PC_104/LgLib/Comm/PMic1300.cpp
-
75PC_104/LgLib/Comm/PMic1300.h
-
55PC_104/LgLib/Comm/PNESHER.bak
-
54PC_104/LgLib/Comm/PNesher.cpp
-
53PC_104/LgLib/Comm/PNesher.h
-
143PC_104/LgLib/Comm/PTZChina.cpp
-
472PC_104/LgLib/Comm/PTZChina.h
-
140PC_104/LgLib/Comm/PTZFlir.cpp
-
108PC_104/LgLib/Comm/PTZFlir.cpp.bak
-
461PC_104/LgLib/Comm/PTZFlir.h
-
456PC_104/LgLib/Comm/PTZFlir.h.bak
-
108PC_104/LgLib/Comm/PTZFlir_N.cpp
-
538PC_104/LgLib/Comm/PTZFlir_N.h
-
140PC_104/LgLib/Comm/PTZPelco.cpp
-
484PC_104/LgLib/Comm/PTZPelco.h
-
508PC_104/LgLib/Comm/PTZPelco.h.bak
-
404PC_104/LgLib/Comm/PTZSRPH.bak
-
108PC_104/LgLib/Comm/PTZSrph.cpp
-
404PC_104/LgLib/Comm/PTZSrph.h
-
108PC_104/LgLib/Comm/PTZVicon.cpp
-
323PC_104/LgLib/Comm/PTZVicon.h
-
336PC_104/LgLib/Comm/PTZm.h
-
214PC_104/LgLib/Comm/ProtLGSm.cpp
-
146PC_104/LgLib/Comm/ProtLGSm.h
-
169PC_104/LgLib/Comm/ProtPTZm.cpp
-
74PC_104/LgLib/Comm/ProtPTZm.h
-
36PC_104/LgLib/Comm/Protocol.cpp
-
32PC_104/LgLib/Comm/Protocol.h
-
132PC_104/LgLib/Comm/ProtocolCCC.cpp
@ -0,0 +1,3 @@ |
|||
PC_104/Debug/* |
|||
PC_104/Release/* |
|||
|
|||
@ -0,0 +1,6 @@ |
|||
<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd"> |
|||
<Workspace Version="10.0" VendorName="SlickEdit"> |
|||
<Projects> |
|||
<Project File="PC_104/PC_104.vpj"/> |
|||
</Projects> |
|||
</Workspace> |
|||
@ -0,0 +1,599 @@ |
|||
[Global] |
|||
CurrentProject=PC_104\PC_104.vpj |
|||
[ProjectDates] |
|||
PC_104\PC_104.vpj=20230718162410515 |
|||
[ActiveConfig] |
|||
PC_104\PC_104.vpj=,Debug |
|||
[TreeExpansion2] |
|||
+@ PC_104\PC_104.vpj |
|||
scroll:0 |
|||
[State] |
|||
MONITOR_CONFIGS: 460 |
|||
MONITOR_CONFIG: 113 0 0 1280 1024 |
|||
SCREEN: 1280 1024 91 70 1247 991 0 0 M 0 0 0 0 1052 887 0 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAE/wAAA6sAAAAAAAAAAAAABP8AAAPXAAAAAuoAAANCAAAAAvsAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAFAAAABAAAAAb7AAAABwAAAAcAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAE/AAAAFsAAAAATgA0ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwAbABnAHMAXABiAG8AYQByAGQALgBjAHAAcAEA/////wAB/AAAAHEAAAAAZAA4ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwATABnAEwAaQBiAFwARABlAHYAaQBjAGUAXABEAEQAbwBwAGwAZQByAC4AYwBwAHAAAP////8AAPwAAABvAAAAAGIANwA6ADoAOgBNADoAXABHAEMAQwBfAFAAcgBvAGoAZQBjAHQAXABQAEMAXwAxADAANABcAEwAZwBMAGkAYgBcAEMAbwBtAG0AXABQAHIAbwB0AEwARwBTAG0ALgBjAHAAcAAA/////wAA/AAAAG8AAAAAYgA2ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwATABnAEwAaQBiAFwAQwBvAG0AbQBcAFAAcgBvAHQAbwBjAG8AbAAuAGMAcABwAAD/////AAD8AAAAXQAAAABQADIAOgA6ADoATQA6AFwARwBDAEMAXwBQAHIAbwBqAGUAYwB0AFwAUABDAF8AMQAwADQAXABMAGcATABpAGIAXABTAHQAZABBAGYAeAAuAGgAAP////8AAPwAAABrAAAAAF4ANQA6ADoAOgBNADoAXABHAEMAQwBfAFAAcgBvAGoAZQBjAHQAXABQAEMAXwAxADAANABcAEwAZwBMAGkAYgBcAEQAZQB2AGkAYwBlAFwAUwB0AGQAQQBmAHgALgBoAAD/////AAD8AAAAXwAAAABSADMAOgA6ADoATQA6AFwARwBDAEMAXwBQAHIAbwBqAGUAYwB0AFwAUABDAF8AMQAwADQAXABMAGcATABpAGIAXABWAGUAcgBzAGkAbwBuAC4AaAAA/////wAAAAAAAA== |
|||
STANDARD_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbclass_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbproctree_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAE/wAAA6sAAAAAAAAAAAAABP8AAAPXAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAN8AAQAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAf///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAEHAAAAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACNQAA/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAE9AAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAO5AAABKAAAAYhJUdSVAAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAABQAAAAN3AAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
APP_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbclass_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbproctree_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAE/wAAA6sAAAAAAAAAAAAABP8AAAPXAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAN8AAQAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAf///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAEHAAAAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACNQAA/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAE9AAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAO5AAABKAAAAYhJUdSVAAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAABQAAAAN3AAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
MONITOR_CONFIG: 114 0 0 1920 1080,-1680 30 1680 1050 |
|||
SCREEN: 1920 1080 130 130 1453 772 0 0 M 0 0 0 0 1498 943 0 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAuoAAAMyAAAAAvsAAAAGAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABfsAAAAGAAAABgAAAAEAAAAFAAAABAAAAAMAAAAAAAAAAvwAAABlAAAAAFgAMwA6ADoAOgBaADoAXABkAHIAXwBmAHIAdQBjAGgAdABcAGwAaQBiAFwAcgBnAG8AbwBzAGUAXAByAGcAbwBvAHMAZQBDAGEAbQBlAHIAYQAuAGMAcABwAQD/////AAH8AAAAlQAAAACIADcAOgA6ADoAWgA6AFwAZAByAF8AZgByAHUAYwBoAHQAXABsAGkAYgBcAHIAZwBvAG8AcwBlAFwAcgBnAG8AbwBzAGUASABhAHIAZAB3AGEAcgBlAFIAZQBzAG8AdQByAGMAZQBTAGUAcgBpAGEAbABQAHIAbwB2AGkAZABlAHIALgBjAHAAcAAA/////wAA/AAAAHkAAAAAbAAyADoAOgA6AFoAOgBcAGQAcgBfAGYAcgB1AGMAaAB0AFwAbABpAGIAXAByAGcAbwBvAHMAZQBcAHIAZwBvAG8AcwBlAE0AbwBkAHUAbABlAEUAbQBiAGUAZABWAGkAZABlAG8ALgBjAHAAcAAA/////wAA/AAAAHsAAAAAbgA0ADoAOgA6AFoAOgBcAGQAcgBfAGYAcgB1AGMAaAB0AFwAbABpAGIAXAByAGcAbwBvAHMAZQBcAHIAZwBvAG8AcwBlAE4AbwBkAGUAUABUAFoAQwBhAG0AQwBvAG4AdAByAG8AbAAuAGMAcABwAAD/////AAD8AAAAgQAAAAB0ADUAOgA6ADoAWgA6AFwAZAByAF8AZgByAHUAYwBoAHQAXABsAGkAYgBcAHIAZwBvAG8AcwBlAFwAcgBnAG8AbwBzAGUATgBvAGQAZQBTAHQAYQB0AGkAYwBDAGEAbQBDAG8AbgB0AHIAbwBsAC4AYwBwAHAAAP////8AAPwAAABfAAAAAFIANgA6ADoAOgBaADoAXABkAHIAXwBmAHIAdQBjAGgAdABcAGwAaQBiAFwAcgBnAG8AbwBzAGUAXAByAGcAbwBvAHMAZQBUAHkAcABlAHMALgBoAAD/////AAAAAAAA |
|||
APP_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbproctree_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbclass_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAaEAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAF2gABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACRgAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAFkAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAXaAAABTwAAAX+VhBd7AAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
|
|||
STANDARD_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbproctree_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbclass_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAaEAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAF2gABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACRgAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAFkAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAXaAAABTwAAAX+VhBd7AAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
MONITOR_CONFIG: 114 0 0 1920 1080,-1920 0 1920 1080 |
|||
SCREEN: 1920 1080 130 130 1492 811 0 0 M 0 0 0 0 1563 943 0 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAE/wAAA6sAAAAAAAAAAAAABP8AAAPXAAAAAuoAAAPGAAAAAvsAAAAHAAAABwAAAAAAAAACAAAAAQAAAAYAAAAFAAAAAwAAAAT7AAAABwAAAAcAAAAAAAAAAQAAAAIAAAAGAAAABQAAAAQAAAAD/AAAAGUAAAAAWAAyADoAOgA6AFoAOgBcAGQAcgBfAGYAcgB1AGMAaAB0AFwAbABpAGIAXAByAGcAbwBvAHMAZQBcAHIAZwBvAG8AcwBlAEMAYQBtAGUAcgBhAC4AYwBwAHABAP////8AAfwAAABvAAAAAGIAMQAyADoAOgA6AFoAOgBcAGQAcgBfAGYAcgB1AGMAaAB0AFwAbABpAGIAXAByAGcAbwBvAHMAZQBcAHIAZwBvAG8AcwBlAE4AbwBkAGUAUwBlAG4AcwBvAHIALgBjAHAAcAAA/////wAA/AAAAGkAAAAAXAA5ADoAOgA6AFoAOgBcAGQAcgBfAGYAcgB1AGMAaAB0AFwAbABpAGIAXABhAGwAZwBcAGcAZQBuAGUAcgBpAGMAXABUAHIAYQBuAHMAZgBvAHIAbQAuAGMAcABwAAD/////AAD8AAAAgQAAAAB0ADMAOgA6ADoAWgA6AFwAZAByAF8AZgByAHUAYwBoAHQAXABsAGkAYgBcAGQAYQB0AGEAXABtAGUAZABpAGEAXAB2AGkAZABlAG8AXAB2AGkAZABlAG8AQQBWAEwASQBCAFMAbwB1AHIAYwBlAC4AYwBwAHAAAP////8AAPwAAAB9AAAAAHAANAA6ADoAOgBaADoAXABkAHIAXwBmAHIAdQBjAGgAdABcAGwAaQBiAFwAZABhAHQAYQBcAG0AZQBkAGkAYQBcAHYAaQBkAGUAbwBcAHYAaQBkAGUAbwBBAFYATABJAEIAUwBvAHUAcgBjAGUALgBoAAD/////AAD8AAAAjwAAAACCADUAOgA6ADoAWgA6AFwAZAByAF8AZgByAHUAYwBoAHQAXABsAGkAYgBcAGQAYQB0AGEAXABtAGUAZABpAGEAXAB2AGkAZABlAG8AXAB2AGkAZABlAG8ATABpAHYAZQA1ADUANQBBAFYATABpAGIAUwBvAHUAcgBjAGUALgBjAHAAcAAA/////wAA/AAAAIsAAAAAfgA2ADoAOgA6AFoAOgBcAGQAcgBfAGYAcgB1AGMAaAB0AFwAbABpAGIAXABkAGEAdABhAFwAbQBlAGQAaQBhAFwAdgBpAGQAZQBvAFwAdgBpAGQAZQBvAEwAaQB2AGUANQA1ADUAQQBWAEwAaQBiAFMAbwB1AHIAYwBlAC4AaAAA/////wAAAAAAAA== |
|||
APP_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbclass_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbproctree_form T=0 |
|||
AAAAAwAAAAEAAAAC2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAWAAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAGGwABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACQgAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAFoAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAYiAAABUwAAAYGm30GqAAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAxADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAXMAAABTwAAAYBjGM+NAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAADaAAAAHgAwAC0AMQA2ADUANAAwADQAOQA2ADYANQA2ADgAMwBOAAAC8AAAAE8AAASPAAAB2gAAAAAAAAAAAAAHfwAABA8AAAAB6wAAAQgAAAAA+wAAAAIAAAACAAAAAAAAAAH7AAAAAgAAAAIAAAAAAAAAAf0AAACLAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQABAAACgAAAAAAAAvsAAAABAAAAAQAAAAD7AAAAAQAAAAEAAAAA/AAAAEEBAAAAIAAwADoAOgA6AF8AdABiAGYAaQBuAGQAXwBmAG8AcgBtAAH/////AAAAAAGQAAABaQAAAYEdCv4eAAAAAPwAAAApAAAAABwAOgA6ADoATQBEAEkAQQBSAEUAQQBUAEkATABFAAH/////AAAAAAAA2wAAAAAAAAAC2wAAAAAAAAAB2wAAAAAAAAAD2wAAAAAAAAAA |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
|
|||
STANDARD_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbclass_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbproctree_form T=0 |
|||
AAAAAwAAAAEAAAAC2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAWAAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAGGwABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACQgAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAFoAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAYiAAABUwAAAYGm30GqAAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAxADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAXMAAABTwAAAYBjGM+NAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAADaAAAAHgAwAC0AMQA2ADUANAAwADQAOQA2ADYANQA2ADgAMwBOAAAC8AAAAE8AAASPAAAB2gAAAAAAAAAAAAAHfwAABA8AAAAB6wAAAQgAAAAA+wAAAAIAAAACAAAAAAAAAAH7AAAAAgAAAAIAAAAAAAAAAf0AAACLAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQABAAACgAAAAAAAAvsAAAABAAAAAQAAAAD7AAAAAQAAAAEAAAAA/AAAAEEBAAAAIAAwADoAOgA6AF8AdABiAGYAaQBuAGQAXwBmAG8AcgBtAAH/////AAAAAAGQAAABaQAAAYEdCv4eAAAAAPwAAAApAAAAABwAOgA6ADoATQBEAEkAQQBSAEUAQQBUAEkATABFAAH/////AAAAAAAA2wAAAAAAAAAC2wAAAAAAAAAB2wAAAAAAAAAD2wAAAAAAAAAA |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
MONITOR_CONFIG: 114 -1920 0 1920 1080,0 0 1920 1080 |
|||
SCREEN: 1920 1080 525 54 1239 931 0 0 M 0 0 0 0 1424 943 0 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAE/wAAA6sAAAAAAAAAAAAABP8AAAPXAAAAAuoAAANCAAAAAvsAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAFAAAABAAAAAb7AAAABwAAAAcAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAE/AAAAFsAAAAATgA0ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwAbABnAHMAXABiAG8AYQByAGQALgBjAHAAcAEA/////wAB/AAAAHEAAAAAZAA4ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwATABnAEwAaQBiAFwARABlAHYAaQBjAGUAXABEAEQAbwBwAGwAZQByAC4AYwBwAHAAAP////8AAPwAAABvAAAAAGIANwA6ADoAOgBNADoAXABHAEMAQwBfAFAAcgBvAGoAZQBjAHQAXABQAEMAXwAxADAANABcAEwAZwBMAGkAYgBcAEMAbwBtAG0AXABQAHIAbwB0AEwARwBTAG0ALgBjAHAAcAAA/////wAA/AAAAG8AAAAAYgA2ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwATABnAEwAaQBiAFwAQwBvAG0AbQBcAFAAcgBvAHQAbwBjAG8AbAAuAGMAcABwAAD/////AAD8AAAAXQAAAABQADIAOgA6ADoATQA6AFwARwBDAEMAXwBQAHIAbwBqAGUAYwB0AFwAUABDAF8AMQAwADQAXABMAGcATABpAGIAXABTAHQAZABBAGYAeAAuAGgAAP////8AAPwAAABrAAAAAF4ANQA6ADoAOgBNADoAXABHAEMAQwBfAFAAcgBvAGoAZQBjAHQAXABQAEMAXwAxADAANABcAEwAZwBMAGkAYgBcAEQAZQB2AGkAYwBlAFwAUwB0AGQAQQBmAHgALgBoAAD/////AAD8AAAAXwAAAABSADMAOgA6ADoATQA6AFwARwBDAEMAXwBQAHIAbwBqAGUAYwB0AFwAUABDAF8AMQAwADQAXABMAGcATABpAGIAXABWAGUAcgBzAGkAbwBuAC4AaAAA/////wAAAAAAAA== |
|||
APP_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbprojects_form T=0 |
|||
_tbclass_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbproctree_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAesAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAFkAABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACSgAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAFgAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAVqAAABSwAAAYix62VPAAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
|
|||
STANDARD_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbprojects_form T=0 |
|||
_tbclass_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbproctree_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAesAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAFkAABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACSgAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAFgAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAVqAAABSwAAAYix62VPAAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
END_MONITOR_CONFIGS: |
|||
CWD: PC_104 |
|||
BUFFER: BN="PC_104\LgLib\StdAfx.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.920 CL=25 LE=0 CX=26 CY=29 WI=5 BI=2 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="PC_104\LgLib\Device\DDopler.cpp""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.26 CL=20 LE=0 CX=21 CY=2 WI=5 BI=6 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="PC_104\LgLib\Comm\ProtLGSm.cpp""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.385 CL=25 LE=0 CX=26 CY=12 WI=5 BI=5 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="PC_104\LgLib\Comm\Protocol.cpp""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.615 CL=22 LE=0 CX=23 CY=20 WI=5 BI=4 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="PC_104\LgLib\Device\StdAfx.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.0 CL=1 LE=0 CX=2 CY=0 WI=5 BI=3 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="PC_104\LgLib\Version.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.566 CL=20 LE=0 CX=21 CY=17 WI=5 BI=1 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="PC_104\lgs\board.cpp""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=119603232 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.510 CL=32 LE=0 CX=33 CY=16 WI=5 BI=7 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 920 864 0 0 N WF=0 WT=2 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="PC_104\LgLib\StdAfx.h""""" |
|||
VIEW: LN=.920 CL=25 LE=0 CX=30 CY=29 WI=15 BI=2 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 920 864 0 0 N WF=0 WT=8 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="PC_104\LgLib\Device\DDopler.cpp""""" |
|||
VIEW: LN=.26 CL=20 LE=0 CX=24 CY=2 WI=18 BI=6 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 920 864 0 0 N WF=0 WT=7 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="PC_104\LgLib\Comm\ProtLGSm.cpp""""" |
|||
VIEW: LN=.385 CL=25 LE=0 CX=30 CY=12 WI=21 BI=5 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 920 864 0 0 N WF=0 WT=6 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="PC_104\LgLib\Comm\Protocol.cpp""""" |
|||
VIEW: LN=.615 CL=22 LE=0 CX=26 CY=20 WI=24 BI=4 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 920 864 0 0 N WF=0 WT=5 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="PC_104\LgLib\Device\StdAfx.h""""" |
|||
VIEW: LN=.0 CL=1 LE=0 CX=5 CY=0 WI=27 BI=3 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 920 864 0 0 N WF=0 WT=3 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="PC_104\LgLib\Version.h""""" |
|||
VIEW: LN=.566 CL=20 LE=0 CX=24 CY=17 WI=30 BI=1 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1050 864 0 0 N WF=0 WT=4 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="PC_104\lgs\board.cpp""""" |
|||
VIEW: LN=.941 CL=21 LE=0 CX=27 CY=26 WI=33 BI=7 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAE/wAAA6sAAAAAAAAAAAAABP8AAAPXAAAAAuoAAANCAAAAAvsAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAFAAAABAAAAAb7AAAABwAAAAcAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAE/AAAAFsAAAAATgA0ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwAbABnAHMAXABiAG8AYQByAGQALgBjAHAAcAEA/////wAB/AAAAHEAAAAAZAA4ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwATABnAEwAaQBiAFwARABlAHYAaQBjAGUAXABEAEQAbwBwAGwAZQByAC4AYwBwAHAAAP////8AAPwAAABvAAAAAGIANwA6ADoAOgBNADoAXABHAEMAQwBfAFAAcgBvAGoAZQBjAHQAXABQAEMAXwAxADAANABcAEwAZwBMAGkAYgBcAEMAbwBtAG0AXABQAHIAbwB0AEwARwBTAG0ALgBjAHAAcAAA/////wAA/AAAAG8AAAAAYgA2ADoAOgA6AE0AOgBcAEcAQwBDAF8AUAByAG8AagBlAGMAdABcAFAAQwBfADEAMAA0AFwATABnAEwAaQBiAFwAQwBvAG0AbQBcAFAAcgBvAHQAbwBjAG8AbAAuAGMAcABwAAD/////AAD8AAAAXQAAAABQADIAOgA6ADoATQA6AFwARwBDAEMAXwBQAHIAbwBqAGUAYwB0AFwAUABDAF8AMQAwADQAXABMAGcATABpAGIAXABTAHQAZABBAGYAeAAuAGgAAP////8AAPwAAABrAAAAAF4ANQA6ADoAOgBNADoAXABHAEMAQwBfAFAAcgBvAGoAZQBjAHQAXABQAEMAXwAxADAANABcAEwAZwBMAGkAYgBcAEQAZQB2AGkAYwBlAFwAUwB0AGQAQQBmAHgALgBoAAD/////AAD8AAAAXwAAAABSADMAOgA6ADoATQA6AFwARwBDAEMAXwBQAHIAbwBqAGUAYwB0AFwAUABDAF8AMQAwADQAXABMAGcATABpAGIAXABWAGUAcgBzAGkAbwBuAC4AaAAA/////wAAAAAAAA== |
|||
FILEHIST: 9 |
|||
PC_104\LgLib\StdAfx.h |
|||
PC_104\LgLib\Version.h |
|||
PC_104\LgLib\Device\StdAfx.h |
|||
PC_104\LgLib\Device\LgDevPTZ.cpp |
|||
PC_104\LgLib\Comm\Protocol.cpp |
|||
PC_104\LgLib\Comm\ProtLGSm.cpp |
|||
PC_104\LgLib\Device\DDopler.cpp |
|||
PC_104\lgs\Comm485.cpp |
|||
PC_104\lgs\board.cpp |
|||
ALLFILEHIST: 64 |
|||
PC_104\LgLib\Version.h |
|||
PC_104\LgLib\Version.cpp |
|||
PC_104\lgs\Stdafx.h |
|||
PC_104\LgLib\StdAfx.h |
|||
PC_104\LgLib\Device\StdAfx.h |
|||
PC_104\LgLib\Comm\Protocol.cpp |
|||
PC_104\LgLib\Comm\ProtLGSm.cpp |
|||
PC_104\LgLib\Device\LgDevPTZ.h |
|||
PC_104\LgLib\Device\LgDevPTZ.cpp |
|||
PC_104\LgLib\Device\LgDevice.h |
|||
PC_104\LgLib\Device\LgDevice.cpp |
|||
PC_104\LgLib\LgBitCod.h |
|||
PC_104\LgLib\LgBitCod.cpp |
|||
PC_104\lgs\kernel.cpp |
|||
PC_104\lgs\isr.h |
|||
PC_104\lgs\getfile.cpp |
|||
PC_104\lgs\filters_.cpp |
|||
PC_104\lgs\Filters.h |
|||
PC_104\lgs\Filters.cpp |
|||
T:\dr_frucht\lib\App\common\deviceNode.h |
|||
T:\dr_frucht\lib\App\common\deviceNode.cpp |
|||
PC_104\lgs\Detector_.cpp |
|||
PC_104\lgs\DETECTOR.cpp |
|||
PC_104\lgs\detecto_.cpp |
|||
PC_104\LgLib\Device\DDopler.cpp |
|||
T:\dr_frucht\lib\App\common\dataBinder_structures.h |
|||
T:\dr_frucht\lib\App\common\dataBinder.h |
|||
T:\dr_frucht\lib\App\common\dataBinder.cpp |
|||
PC_104\lgs\Comm485.cpp |
|||
PC_104\lgs\board.h |
|||
PC_104\lgs\board.cpp |
|||
T:\dr_frucht\lib\components\base\basicTypes.h |
|||
T:\dr_frucht\lib\components\base\basicTransport.h |
|||
T:\dr_frucht\lib\components\base\basicTransport.cpp |
|||
T:\dr_frucht\lib\components\base\basicThread.h |
|||
T:\dr_frucht\lib\components\base\basicThread.cpp |
|||
T:\dr_frucht\lib\components\base\basicSettingsProvider.h |
|||
T:\dr_frucht\lib\components\base\basicSettingsProvider.cpp |
|||
T:\dr_frucht\lib\components\base\basicSettings.h |
|||
T:\dr_frucht\lib\components\base\basicPosition.h |
|||
T:\dr_frucht\lib\components\base\basicPosition.cpp |
|||
T:\dr_frucht\lib\components\base\basicObject.h |
|||
T:\dr_frucht\lib\components\base\basicObject.cpp |
|||
T:\dr_frucht\Projects\lib\components\base\basicMediaSource.h |
|||
T:\dr_frucht\lib\components\base\basicMediaSource.h |
|||
T:\dr_frucht\lib\components\base\basicMediaSource.cpp |
|||
T:\dr_frucht\Projects\lib\components\base\basicMediaDestination.h |
|||
T:\dr_frucht\lib\components\base\basicMediaDestination.h |
|||
T:\dr_frucht\lib\components\base\basicMediaDestination.cpp |
|||
T:\dr_frucht\lib\components\base\basicLIBAV.h |
|||
T:\dr_frucht\lib\components\base\basicLIBAV.cpp |
|||
T:\dr_frucht\lib\components\base\basicFunctionality.h |
|||
T:\dr_frucht\lib\components\base\basicFunctionality.cpp |
|||
T:\dr_frucht\lib\components\base\basicEventHeap.h |
|||
T:\dr_frucht\lib\components\base\basicEventHeap.cpp |
|||
T:\dr_frucht\lib\components\base\basicEventHandler.h |
|||
T:\dr_frucht\lib\components\base\basicEvent.h |
|||
T:\dr_frucht\lib\components\base\basicEvent.cpp |
|||
T:\dr_frucht\lib\components\base\basicEngine.h |
|||
T:\dr_frucht\lib\components\base\basicEngine.cpp |
|||
T:\dr_frucht\lib\components\base\basicCameraInfo.h |
|||
T:\dr_frucht\lib\components\base\basicCameraInfo.cpp |
|||
T:\dr_frucht\lib\App\argus\ArgusBackend.cpp |
|||
T:\dr_frucht\lib\hardware\soc\general\3DLRF.h |
|||
DEBUG: 0 0 0 0 5 0 gdb |
|||
printf |
|||
strcpy |
|||
strcmp |
|||
std::* |
|||
boost::* |
|||
DEBUG2: 0 |
|||
TBCLASS: 0 0 |
|||
Binary file not shown.
@ -0,0 +1,2 @@ |
|||
:02FFFE00ABCD77 |
|||
:00000001FF |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,196 @@ |
|||
CWSDPMI is Copyright (C) 1995-2010 Charles W Sandmann (cwsdpmi@earthlink.net) |
|||
1206 Braelinn, Sugar Land, TX 77479 |
|||
|
|||
This is release 7. The files in this binary distribution may be redistributed |
|||
under the GPL (with source) or without the source code provided: |
|||
|
|||
* CWSDPMI.EXE or CWSDPR0.EXE are not modified in any way except via CWSPARAM. |
|||
|
|||
* CWSDSTUB.EXE internal contents are not modified in any way except via |
|||
CWSPARAM or STUBEDIT. It may have a COFF image plus data appended to it. |
|||
|
|||
* Notice to users that they have the right to receive the source code and/or |
|||
binary updates for CWSDPMI. Distributors should indicate a site for the |
|||
source in their documentation. |
|||
|
|||
------------------------------------------------------------------------------- |
|||
|
|||
The purpose of this release is to allow high performance access to large |
|||
amounts of physical memory (up to 4GB). Memory above 32-bit address space |
|||
(common on machines over 3GB physical memory) will be mapped to fill the |
|||
address hole to provide a full 4GB memory. 4MB pages will be automatically |
|||
used for large memory requests. Release 5 works well for systems using 256MB |
|||
or less of memory; release 7 is useful for quick access to over 500MB. |
|||
|
|||
Known limitations with 4MB pages: |
|||
1) 4Mb regions are treated as locked (non-pageable). Virtual memory may be |
|||
less effective. |
|||
2) DPMI 1.0 extensions to manage page attributes will not work on 4MB pages. |
|||
3) DPMI function 0x503 to resize memory is not supported if it requires the |
|||
memory zone to be moved in physical memory and it contains a 4Mb page. |
|||
Note: CWSPARAM bit 3, (bitmask 8) can be used to suppress using 4Mb pages. |
|||
|
|||
CWSDPMI was written to provide DPMI services for V2 of DJGPP. It |
|||
does not support 16-bit DPMI applications, or DPMI applications requiring a |
|||
built in extender. It does support virtual memory and hardware interrupt |
|||
reflection from real mode to protected mode. DJGPP V1.1x and RSX applications |
|||
will also run using this server, which can be used to provide enhanced control |
|||
over hardware interrupts. Some DPMI 1.0 extensions (0x506, 0x507, 0x508) have |
|||
been implemented. |
|||
|
|||
CWSDPR0.EXE is an alternate version which runs at ring 0 with virtual memory |
|||
disabled. It may be used if access to ring-0 features are desired. It |
|||
currently does not switch stacks on HW interrupts, so some DJGPP features |
|||
such as SIGINT and SIGFPE are not supported and will generate a double fault |
|||
or stack fault error (to be fixed someday). |
|||
|
|||
CWSDSTUB.EXE is a stub loader image for DJGPP which includes CWSDPMI. This |
|||
allows single executable image distributions. You can use the EXE2COFF |
|||
program and COPY /B CWSDSTUB.EXE+yourimage yourimage.exe to create a |
|||
standalone executable image. CWSDSTR0.EXE is the ring 0 stub. |
|||
|
|||
Some of the internal tuning and configuration parameters may be modified |
|||
in the image using CWSPARAM.EXE (see CWSPARAM.DOC). |
|||
|
|||
If you want to use CWSDPMI with DJGPP, you expand the distribution into the |
|||
DJGPP directory tree. CWSDPMI.EXE will be put in the BIN directory with your |
|||
DJGPP images and it will automatically be loaded when they run. |
|||
|
|||
Directions for use (server can be used in either of two different ways): |
|||
|
|||
1) "cwsdpmi" alone with no parameters will terminate and stay resident |
|||
FOR A SINGLE DPMI PROCESS. This means it unloads itself when your |
|||
DPMI application exits. This mode is useful in software which needs |
|||
DPMI services, since CWSDPMI can be exec'ed and then will unload on exit. |
|||
|
|||
2) "cwsdpmi -p" will terminate and stay resident until you remove it. |
|||
It can be loaded into UMBs with LH. "cwsdpmi -u" will unload the TSR. |
|||
|
|||
3) The file used for virtual memory swapping, if desired, is controlled |
|||
by the "-sc:\cwsdpmi.swp" syntax on the command line. You must specify |
|||
either a file with full disk/directory syntax, or "-s-" which disables |
|||
virtual memory. If -s is used, it must be the last option on the command |
|||
line, since all characters after -s will be treated as the swap file name. |
|||
|
|||
4) The default swap file name is c:\cwsdpmi.swp, but this can be changed |
|||
with the CWSPARAM image, as can some other parameters. |
|||
|
|||
5) You can disable the DPMI 1.0 extensions by starting the image with the |
|||
"cwsdpmi -x" syntax. This feature allows you to run programs developed |
|||
under other DPMI providers which do not behave properly with these |
|||
extensions enabled (typically use of NULL pointers). |
|||
|
|||
If you are using an EMM provider for UMBs, CWSDPMI will need to use VCPI. |
|||
VCPI memory prevents usage of 4MB pages, so for best performance with an EMM |
|||
provider I recommend suppressing VCPI memory. For example, with JEMM386 |
|||
this can be done with: JEMM386 LOAD MAX=0 |
|||
|
|||
I would like to give special thanks to DJ Delorie who wrote the original |
|||
GO32 code on which CWSDPMI is based. Morten Welinder also provided and |
|||
improved much of the code in this program. |
|||
|
|||
------------------------------------------------------------------------------- |
|||
|
|||
This section contains a list of the error messages you might see out of |
|||
CWSDPMI and some details on what they mean. |
|||
|
|||
Exceptions are only handled by CWSDPMI if the application does not establish |
|||
an exception handler, exceptions nest 5 deep, or the error is particularly bad: |
|||
|
|||
"Page fault" - |
|||
1) an illegal page fault happens in a RMCB or HW interrupt, (lock all pages!) |
|||
2) all available pages have been locked, |
|||
3) the application is using non-committed pages for null pointer protection. |
|||
"Double Fault" - multiple exceptions occurred |
|||
"Invalid TSS" - typically due to RMCB or HW interrupt being called after the |
|||
selectors/memory have been deallocated (remember to reset the mouse) |
|||
"General Protection Fault" - bad parameter sent to a DPMI call |
|||
|
|||
"80386 required." |
|||
|
|||
Since 80286 and lesser processors don't have the hardware necessary to |
|||
run CWSDPMI. No workaround, upgrade. |
|||
|
|||
"DOS 3 required." |
|||
|
|||
A few interrupts are used which need DOS 3.0 or higher. I don't expect to |
|||
ever see this message, since 80386 machines were introduced after DOS 3.0 |
|||
and that check is made first. |
|||
|
|||
"CWSDPMI V0.90+ (r7) Copyright (C) 2010 CW Sandmann ABSOLUTELY NO WARRANTY" |
|||
|
|||
An informational message displayed if the program is not run in one-pass mode. |
|||
|
|||
"Protected mode not accessible." |
|||
|
|||
This message should only be displayed if running CWSDPMI in a protected |
|||
environment with no access to protected mode. In this case, DPMI should |
|||
already be available and CWSDPMI would not be needed. This might happen if |
|||
a 16-bit DPMI client is loaded and a DJGPP image attempts to load CWSDPMI |
|||
to provide 32-bit DPMI services under Windows. |
|||
|
|||
"Warning: cannot open swap file c:\cwsdpmi.swp" |
|||
|
|||
Maybe you are out of file handles, or the swap file name is incorrectly |
|||
specified in the image (change the name with cwsparam). |
|||
|
|||
"No swap space!" |
|||
|
|||
This message means you tried to use more swap file than CWSDPMI was |
|||
configured to handle. Since this is protected against in the memory |
|||
allocation code you should never see this message, except when swapping |
|||
is disabled and you run out of DOS memory for page tables (greater than |
|||
400MB of memory without 4MB pages). |
|||
|
|||
"Swap disk full!" |
|||
|
|||
This means the swap file could not be expanded when trying to swap |
|||
memory out to disk. This would normally not be seen, unless you are |
|||
writing output to the same disk which holds the swap file. Decrease |
|||
the amount of memory your DPMI application is using or free up disk space. |
|||
|
|||
"Interrupt 0x??" |
|||
|
|||
Your application tried to call an interrupt from protected mode which |
|||
normally shouldn't be called (something like a data pointer). If the |
|||
request was allowed to continue it would likely hang your machine. If you |
|||
see this message and think the interrupt should be allowed to continue, let |
|||
me know. |
|||
|
|||
"Error: Using XMS switched CPU into V86 mode." |
|||
|
|||
This message might be seen if you have your memory manager in AUTO mode. The |
|||
only workaround in this case is to stop using AUTO mode. |
|||
|
|||
"Error: could not allocate page table memory" |
|||
|
|||
The page table memory (a minimum of 16Kb) is allocated from conventional |
|||
memory (either in the 640Kb region or UMBs). If CWSDPMI cannot allocate the |
|||
minimum necessary memory, you would see this message. Free up some |
|||
conventional memory. You may also see this message if a page directory needs |
|||
to be faulted in, and there are no available pages. This means too many pages |
|||
have been locked for the allocated page tables available. While CWSDPMI |
|||
tries to dynamically allocate these if needed, this effort failed. You need |
|||
to increase the number of page tables with CWSPARAM, or increase the amount |
|||
of free conventional memory if it is low. If the application which calls |
|||
CWSDPMI internally manages all the DOS memory, the page tables may need to |
|||
be pre-allocated at DPMI startup time (if this is needed, try using the |
|||
run option flag 2 in cwsparam). |
|||
|
|||
"16-bit DPMI unsupported." |
|||
|
|||
CWSDPMI is a 32-bit only DPMI server. Ideally, on the request to enter DPMI's |
|||
PM with a 16-bit request, we would just fail the call setting the carry bit |
|||
like the DPMI specification describes. Some buggy 16-bit compiler tools don't |
|||
check the return status and will hang the machine in this case. So, I issue |
|||
an error message and exit the image instead. |
|||
|
|||
"Descriptors exhausted." |
|||
|
|||
An attempt to nest a DPMI client failed in the setup phase due to insufficient |
|||
free selectors in the LDT. |
|||
|
|||
"CWSDPMI not removed" |
|||
|
|||
When the -u parameter is specified, if DPMI is not detected this message is |
|||
printed. Informational. |
|||
@ -0,0 +1,103 @@ |
|||
CWSPARAM provided by Charles W Sandmann (cwsdpmi@earthlink.net) |
|||
1206 Braelinn, Sugar Land, TX 77479 |
|||
CWSPARAM OVERVIEW |
|||
|
|||
There are certain parameters built into the CWSDPMI.EXE, CWSDPR0.EXE, and |
|||
CWSDSTUB.EXE images which might need to be modified for distributing some |
|||
programs for better performance. The modified image could be renamed, and |
|||
then the DPMI server name in a DJGPP V2 image may be stubedited to use the |
|||
new name. CWSPARAM can also be run directly on images created by appending |
|||
COFF images to CWSDSTUB.EXE. The parameters which can be modified are |
|||
discussed below: |
|||
|
|||
Full name of paging file ("" to disable) ? [c:\cwsdpmi.swp] |
|||
|
|||
This is where the file which provides virtual memory should be located. It |
|||
may be desirable to change the default to a faster disk or one with more |
|||
free space. To disable paging, enter two double quotes. The file name |
|||
MUST contain the disk, full path, and file name. Anything less may cause |
|||
unpredictable behavior. The maximum length of the name is 48 characters, |
|||
and it must be a DOS 8.3 style name. Press return to keep the current value. |
|||
|
|||
Number of page tables to initially allocate (0=auto) ? [0] |
|||
|
|||
Page tables are stored in the DOS memory area and consume this precious |
|||
resource. The default value of 0 chooses automatic allocation of enough |
|||
page tables to hold all of the physical memory without paging (with the |
|||
minimum enough to hold 20Mb without paging and a maximum to hold 128Mb). |
|||
If your program is a fixed size (and does not spawn any other DPMI images) |
|||
you can specify one page table for each 4Mb of your program's size. If |
|||
your program is small, this can save a small amount of DOS memory, which |
|||
might be needed for other purposes. If your program is large (typically |
|||
larger than the physical memory) specifying a number will consume more DOS |
|||
memory but improve performance since the page tables themselves will not |
|||
page. CWSDPMI will attempt to dynamically allocate additional page tables |
|||
at run time to prevent paging, but if all of the DOS memory is free, |
|||
performance would be degraded. Remember to add an extra page table if |
|||
mapping physical devices. As of r5, you must also allocate additional |
|||
space for the bitmaps for physical and virtual memory (one bit for each |
|||
4K page). Add one page for each 128Mb of total address space |
|||
(physical+virtual). Be generous, since someone may run the image on a |
|||
512Mb machine (or larger) and require 4 pages for the physical bitmap |
|||
even if you disable virtual memory. |
|||
|
|||
Minimum application memory desired before 640K paging ? [512Kb] |
|||
|
|||
Typically, CWSDPMI only uses extended memory to return as DPMI memory, and |
|||
saves the DOS memory area for DOS requests. On small memory machines with |
|||
applications not needing much DOS memory (or poorly tuned memory management) |
|||
there may be very little extended memory left available, with up to 600K of |
|||
DOS memory unused. This parameter determines the threshold which CWSDPMI |
|||
should start using DOS memory as DPMI memory. If an application is known to |
|||
not need much DOS memory, this value could be set to the size of the memory |
|||
required for the image, which provides roughly 0.5Mb additional memory before |
|||
paging happens. This parameter is one I would expect might be adjusted when |
|||
distributing an application for maximum performance on a wide variety of |
|||
machines. |
|||
|
|||
Paragraphs of DOS memory to reserve when 640K paging ? [3840] |
|||
|
|||
If the image needs to page in the DOS memory area (triggered by the parameter |
|||
value above), this parameter tells how much DOS memory to save for DOS |
|||
allocation requests. The value is in paragraphs (16 byte increments), so the |
|||
default is 60Kbytes. You will actually end up with a bit more probably, since |
|||
the page tables are allocated on 4Kbyte rounded boundaries. Some amount of |
|||
DOS memory needs to be saved for potentially expanding the file table, the |
|||
sbrk() algorithm, DMA buffers, etc. This amount can be tuned on an image |
|||
by image basis, and may be as little as 0. |
|||
|
|||
Paragraphs of memory for extra CWSDPMI internal heap ? [256] |
|||
|
|||
CWSDPMI is built with an internal 4K heap. Each nested task consumes around |
|||
300 bytes, each memory zone takes 12 bytes, and each HW interrupt (nested) |
|||
takes around 850 bytes. If extra DOS memory is available, the additional |
|||
paragraphs specified here are added to the heap at execution time by DOS. |
|||
The 8K default should be good for up to 40Mb in small requests. If you |
|||
compile very large C++ programs or allocate lots of memory in small pieces, |
|||
you might need to bump this parameter. If you are very tight on memory, |
|||
you could decrease it to zero and pick up another 4K of DOS memory. Each |
|||
paragraph allows a little more than one more memory zone (or in the worse |
|||
case around 85Kb of DPMI memory). |
|||
|
|||
Maximum size of swap file ? [128Mb] |
|||
|
|||
CWSDPMI dynamically allocates memory at run time for up to 2044Mb of swap file |
|||
space. The bitmap for the swap usage requires 32 bytes of memory per 1Mb of |
|||
swap usage. The default will provide up to 128Mb of swap space with a run |
|||
time memory requirement of 4Kb DOS memory. The dynamic allocation is limited |
|||
by the free space on the drive, so if you don't have much space on your hard |
|||
drive, you don't need to worry about this. If you run small programs and want |
|||
to save memory (maybe to stuff the allocation in a UMB) you can decrease this |
|||
value. If you want to run monster programs needing 2Gb of address space you |
|||
can increase this value (but this would increase the DOS memory usage). This |
|||
value is ignored by CWSDPR0. |
|||
|
|||
Value of run option flags ? [0] |
|||
|
|||
There are a few run-time options in CWSDPMI which should not be needed by most |
|||
users which can be activated by this field of bit flags: |
|||
Bit 0 (1): Disable allocation of run time page tables in UMBs (low only) |
|||
Bit 1 (2): Pre-allocate page table memory (in DPMI memory request) |
|||
Bit 2 (4): Disable DPMI 1.0 extensions (Null page protection, mapping) |
|||
Bit 3 (8): Disable use of 4MB pages (very large memory support) |
|||
Other values should be zero for future compatibility but are currently ignored. |
|||
@ -0,0 +1,85 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: LgAdvantechDeviceEnumerator.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of LgAdvantechDeviceEnumerator.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
#include "LgAdvantechDeviceEnumerator.h"
|
|||
|
|||
CLgAdvantechDeviceEnumerator::CLgAdvantechDeviceEnumerator() |
|||
{ |
|||
m_pDeviceList = NULL; |
|||
m_nDeviceCount = 0; |
|||
} |
|||
|
|||
CLgAdvantechDeviceEnumerator::~CLgAdvantechDeviceEnumerator() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CLgAdvantechDeviceEnumerator::Create() |
|||
{ |
|||
// destroy old creature
|
|||
Destroy(); |
|||
|
|||
// get device count
|
|||
SHORT NumOfDevices; |
|||
if( DRV_DeviceGetNumOfList( &NumOfDevices ) != SUCCESS ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, "CLgAdvantechDeviceEnumerator::Create", "DRV_DeviceGetNumOfList failed" ); |
|||
return FALSE; |
|||
}; |
|||
|
|||
// aloc memory for list
|
|||
DEVLIST *pDeviceList = (DEVLIST*)malloc( sizeof(DEVLIST) * NumOfDevices ); |
|||
if( !pDeviceList ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, "CLgAdvantechDeviceEnumerator::Create", "Out of memory during device list allocation" ); |
|||
return FALSE; |
|||
} |
|||
|
|||
// get devices info
|
|||
SHORT FilledNumOfDevices; |
|||
if( DRV_DeviceGetList( pDeviceList, NumOfDevices, &FilledNumOfDevices ) != SUCCESS ) |
|||
{ |
|||
// free memory for device list
|
|||
free( pDeviceList ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, "CLgAdvantechDeviceEnumerator::Create", "DRV_DeviceGetList failed" ); |
|||
return FALSE; |
|||
} |
|||
|
|||
m_pDeviceList = pDeviceList; |
|||
m_nDeviceCount = NumOfDevices; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CLgAdvantechDeviceEnumerator::Destroy() |
|||
{ |
|||
if( m_pDeviceList ) |
|||
{ |
|||
free( m_pDeviceList ); |
|||
m_pDeviceList = NULL; |
|||
} |
|||
|
|||
m_nDeviceCount = 0; |
|||
} |
|||
|
|||
INT CLgAdvantechDeviceEnumerator::GetDeviceCount() |
|||
{ |
|||
return m_nDeviceCount; |
|||
} |
|||
|
|||
DEVLIST* CLgAdvantechDeviceEnumerator::GetDevice( INT nDevice ) |
|||
{ |
|||
return ( nDevice >= 0 && nDevice < m_nDeviceCount ) ? m_pDeviceList + nDevice : NULL; |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: LgLibAdvantech |
|||
// FILE: LgAdvantechDeviceEnumerator.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CLgAdvantechDeviceEnumerator |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __LG__ADVANTECH__DEVICE__ENUMERATOR__H__INCLUDED__ |
|||
#define __LG__ADVANTECH__DEVICE__ENUMERATOR__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif |
|||
|
|||
#include "AdsApi\Include\Driver.h" |
|||
|
|||
class CLgAdvantechDeviceEnumerator |
|||
{ |
|||
public: |
|||
CLgAdvantechDeviceEnumerator(); |
|||
virtual ~CLgAdvantechDeviceEnumerator(); |
|||
|
|||
public: |
|||
BOOL Create(); |
|||
void Destroy(); |
|||
|
|||
public: |
|||
INT GetDeviceCount(); |
|||
DEVLIST *GetDevice( INT nDevice ); |
|||
|
|||
private: |
|||
INT m_nDeviceCount; |
|||
DEVLIST *m_pDeviceList; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,346 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: LgAdvantechPCI1762.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of LgAdvantechPCI1762.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
#include "LgAdvantechPCI1762.h"
|
|||
|
|||
CLgAdvantechPCI1762::CLgAdvantechPCI1762() |
|||
{ |
|||
m_hDevice = NULL; |
|||
m_bEvent = FALSE; |
|||
|
|||
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgAdvantechPCI1762::CLgAdvantechPCI1762") ); |
|||
} |
|||
|
|||
CLgAdvantechPCI1762::~CLgAdvantechPCI1762() |
|||
{ |
|||
Destroy(); |
|||
|
|||
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgAdvantechPCI1762::~CLgAdvantechPCI1762") ); |
|||
} |
|||
|
|||
BOOL CLgAdvantechPCI1762::Create( INT nDevice ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
__try |
|||
{ |
|||
// open device
|
|||
DWORD dwResult = DRV_DeviceOpen( nDevice, &m_hDevice ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::Create"), _T("DRV_DeviceOpen failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
// enable event handling
|
|||
PT_EnableEvent EventSetting; |
|||
EventSetting.EventType = ADS_EVT_INTERRUPT; |
|||
EventSetting.Enabled = TRUE; |
|||
EventSetting.Count = 1; |
|||
dwResult = DRV_EnableEvent( m_hDevice, &EventSetting ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::Create"), _T("DRV_EnableEvent failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
m_bEvent = TRUE; |
|||
} |
|||
__except( EXCEPTION_EXECUTE_HANDLER ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::Create"), _T("Exception 0x%08X"), _exception_code() ); |
|||
|
|||
return FALSE; |
|||
} |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CLgAdvantechPCI1762::Destroy() |
|||
{ |
|||
if( m_hDevice != NULL ) |
|||
{ |
|||
if( m_bEvent ) |
|||
{ |
|||
PT_EnableEvent EventSetting; |
|||
EventSetting.EventType = ADS_EVT_INTERRUPT; |
|||
EventSetting.Enabled = FALSE; |
|||
EventSetting.Count = 1; |
|||
DWORD dwResult = DRV_EnableEvent( m_hDevice, &EventSetting ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::Destroy"), _T("DRV_EnableEvent failed with <%s>"), pErrorMessage ); |
|||
} |
|||
|
|||
m_bEvent = FALSE; |
|||
} |
|||
|
|||
DRV_DeviceClose( &m_hDevice ); |
|||
m_hDevice = NULL; |
|||
} |
|||
} |
|||
|
|||
BOOL CLgAdvantechPCI1762::WaitForEvent( DWORD dwTimeout ) |
|||
{ |
|||
if( !m_hDevice ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::WaitForEvent"), _T("Device handle is not valid") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
USHORT usEventType = 0; |
|||
PT_CheckEvent ptCheckEvent; |
|||
ptCheckEvent.EventType = &usEventType; |
|||
ptCheckEvent.Milliseconds = dwTimeout; |
|||
|
|||
if( DRV_CheckEvent( m_hDevice, &ptCheckEvent ) != SUCCESS ) |
|||
return FALSE; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
BOOL CLgAdvantechPCI1762::SetDirectOutput( INT nBit, BOOL bOn ) |
|||
{ |
|||
if( !m_hDevice ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::SetDirectOutput"), _T("Device handle is not valid") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
PT_DioWriteBit dioWriteBit; |
|||
dioWriteBit.port = nBit / 8; |
|||
dioWriteBit.bit = nBit % 8; |
|||
dioWriteBit.state = bOn; |
|||
DWORD dwResult = DRV_DioWriteBit( m_hDevice, &dioWriteBit ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::SetDirectOutput"), _T("DRV_DioWriteBit failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
BOOL CLgAdvantechPCI1762::SetDirectOutputAll( DWORD dwMask, DWORD dwState ) |
|||
{ |
|||
if( !m_hDevice ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::SetDirectOutputAll"), _T("Device handle is not valid") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
// write first part
|
|||
PT_DioWritePortByte dioWritePortByte; |
|||
dioWritePortByte.port = 0; |
|||
dioWritePortByte.mask = (SHORT)(dwMask & 0x00FF); |
|||
dioWritePortByte.state = (SHORT)(dwState & 0x00FF); |
|||
DWORD dwResult = DRV_DioWritePortByte( m_hDevice, &dioWritePortByte ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::SetDirectOutputAll"), _T("DRV_DioWritePortByte for first part failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
// write second part
|
|||
dioWritePortByte.port = 1; |
|||
dioWritePortByte.mask = (SHORT)( ( dwMask >> 8 ) & 0x00FF); |
|||
dioWritePortByte.state = (SHORT)( ( dwState >> 8 ) & 0x00FF); |
|||
dwResult = DRV_DioWritePortByte( m_hDevice, &dioWritePortByte ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::SetDirectOutputAll"), _T("DRV_DioWritePortByte for second part failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
BOOL CLgAdvantechPCI1762::GetDirectOutput( INT nBit, PBOOL pOn ) |
|||
{ |
|||
if( !m_hDevice ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::GetDirectOutput"), _T("Device handle is not valid") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
if( !pOn ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::GetDirectOutput"), _T("Passed NULL pointer for output") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
USHORT state; |
|||
PT_DioGetCurrentDOBit dioGetCurrentDOBit; |
|||
dioGetCurrentDOBit.port = nBit / 8; |
|||
dioGetCurrentDOBit.bit = nBit % 8; |
|||
dioGetCurrentDOBit.state = &state; |
|||
DWORD dwResult = DRV_DioGetCurrentDOBit( m_hDevice, &dioGetCurrentDOBit ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::GetDirectOutput"), _T("DRV_DioGetCurrentDOBit failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
*pOn = state; |
|||
return TRUE; |
|||
} |
|||
|
|||
BOOL CLgAdvantechPCI1762::GetDirectOutputAll( DWORD dwMask, PDWORD pState ) |
|||
{ |
|||
if( !m_hDevice ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::GetDirectOutputAll"), _T("Device handle is not valid") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
if( !pState ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::GetDirectOutputAll"), _T("Passed NULL pointer for output") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
USHORT state; |
|||
PT_DioGetCurrentDOByte dioGetCurrentDOByte; |
|||
dioGetCurrentDOByte.port = 0; |
|||
dioGetCurrentDOByte.value = &state; |
|||
DWORD dwResult = DRV_DioGetCurrentDOByte( m_hDevice, &dioGetCurrentDOByte ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::GetDirectOutputAll"), _T("DRV_DioGetCurrentDOByte for first part failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
*pState = (DWORD)state; |
|||
|
|||
dioGetCurrentDOByte.port = 1; |
|||
dioGetCurrentDOByte.value = &state; |
|||
dwResult = DRV_DioGetCurrentDOByte( m_hDevice, &dioGetCurrentDOByte ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::GetDirectOutput2All"), _T("DRV_DioGetCurrentDOByte for second part failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
*pState |= (DWORD)(state << 8); |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
BOOL CLgAdvantechPCI1762::GetDirectInput( INT nBit, PBOOL pOn ) |
|||
{ |
|||
if( !m_hDevice ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::GetDirectInput"), _T("Device handle is not valid") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
if( !pOn ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::GetDirectInput"), _T("Passed NULL pointer for output") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
USHORT state; |
|||
PT_DioReadBit dioReadBit; |
|||
dioReadBit.port = nBit / 8; |
|||
dioReadBit.bit = nBit % 8; |
|||
dioReadBit.state = &state; |
|||
DWORD dwResult = DRV_DioReadBit( m_hDevice, &dioReadBit ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::GetDirectInput"), _T("DRV_DioReadBit failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
*pOn = state; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
BOOL CLgAdvantechPCI1762::GetDirectInputAll( DWORD dwMask, PDWORD pState ) |
|||
{ |
|||
if( !m_hDevice ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::GetDirectInputAll"), _T("Device handle is not valid") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
if( !pState ) |
|||
{ |
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_WARNING, this, _T("CLgAdvantechPCI1762::GetDirectInputAll"), _T("Passed NULL pointer for output") ); |
|||
return FALSE; |
|||
} |
|||
|
|||
USHORT state; |
|||
PT_DioReadPortByte dioReadPortByte; |
|||
dioReadPortByte.port = 0; |
|||
dioReadPortByte.value = &state; |
|||
DWORD dwResult = DRV_DioReadPortByte( m_hDevice, &dioReadPortByte ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::SetDirectOutputAll"), _T("DRV_DioReadPortByte for first part failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
*pState = (DWORD)state; |
|||
|
|||
dioReadPortByte.port = 1; |
|||
dioReadPortByte.value = &state; |
|||
dwResult = DRV_DioReadPortByte( m_hDevice, &dioReadPortByte ); |
|||
if( dwResult != SUCCESS ) |
|||
{ |
|||
TCHAR pErrorMessage[MAX_PATH]; |
|||
DRV_GetErrorMessage( dwResult, pErrorMessage ); |
|||
|
|||
LGLOG( LOG_LEVEL_LOW, LOG_TYPE_ERROR, this, _T("CLgAdvantechPCI1762::SetDirectOutputAll"), _T("DRV_DioReadPortByte for second part failed with <%s>"), pErrorMessage ); |
|||
return FALSE; |
|||
} |
|||
|
|||
*pState |= (DWORD)(state << 8); |
|||
|
|||
return TRUE; |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright Š 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: LgLibAdvantech |
|||
// FILE: LgAdvantechPCI1762.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CLgAdvantechPCI1762 |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __LG__ADVANTECH__PCI__1762__H__INCLUDED__ |
|||
#define __LG__ADVANTECH__PCI__1762__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif |
|||
|
|||
#include "AdsApi\Include\Driver.h" |
|||
#include "..\Device\LgDeviceGPIO.h" |
|||
|
|||
class CLgAdvantechPCI1762// : public CLgDeviceGPIO |
|||
{ |
|||
public: |
|||
CLgAdvantechPCI1762(); |
|||
virtual ~CLgAdvantechPCI1762(); |
|||
|
|||
public: |
|||
BOOL Create( INT nDevice ); |
|||
void Destroy(); |
|||
|
|||
public: |
|||
BOOL WaitForEvent( DWORD dwTimeout ); |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
DIM_00 = 0x000000001UL, |
|||
DIM_01 = 0x000000002UL, |
|||
DIM_02 = 0x000000004UL, |
|||
DIM_03 = 0x000000008UL, |
|||
DIM_04 = 0x000000010UL, |
|||
DIM_05 = 0x000000020UL, |
|||
DIM_06 = 0x000000040UL, |
|||
DIM_07 = 0x000000080UL, |
|||
DIM_08 = 0x000000100UL, |
|||
DIM_09 = 0x000000200UL, |
|||
DIM_10 = 0x000000400UL, |
|||
DIM_11 = 0x000000800UL, |
|||
DIM_12 = 0x000001000UL, |
|||
DIM_13 = 0x000002000UL, |
|||
DIM_14 = 0x000004000UL, |
|||
DIM_15 = 0x000008000UL, |
|||
DIM_ALL = 0x00000FFFFUL, |
|||
|
|||
DOM_00 = 0x000000001UL, |
|||
DOM_01 = 0x000000002UL, |
|||
DOM_02 = 0x000000004UL, |
|||
DOM_03 = 0x000000008UL, |
|||
DOM_04 = 0x000000010UL, |
|||
DOM_05 = 0x000000020UL, |
|||
DOM_06 = 0x000000040UL, |
|||
DOM_07 = 0x000000080UL, |
|||
DOM_08 = 0x000000100UL, |
|||
DOM_09 = 0x000000200UL, |
|||
DOM_10 = 0x000000400UL, |
|||
DOM_11 = 0x000000800UL, |
|||
DOM_12 = 0x000001000UL, |
|||
DOM_13 = 0x000002000UL, |
|||
DOM_14 = 0x000004000UL, |
|||
DOM_15 = 0x000008000UL, |
|||
DOM_ALL = 0x00000FFFFUL |
|||
}; |
|||
|
|||
public: |
|||
BOOL SetDirectOutput( INT nBit, BOOL bOn ); |
|||
BOOL SetDirectOutputAll( DWORD dwMask, DWORD dwState ); |
|||
|
|||
BOOL GetDirectOutput( INT nBit, PBOOL pOn ); |
|||
BOOL GetDirectOutputAll( DWORD dwMask, PDWORD pState ); |
|||
|
|||
BOOL GetDirectInput( INT nBit, PBOOL pOn ); |
|||
BOOL GetDirectInputAll( DWORD dwMask, PDWORD pState ); |
|||
|
|||
private: |
|||
LONG m_hDevice; |
|||
BOOL m_bEvent; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,125 @@ |
|||
# Microsoft Developer Studio Project File - Name="LgLibAdvantech" - Package Owner=<4> |
|||
# Microsoft Developer Studio Generated Build File, Format Version 6.00 |
|||
# ** DO NOT EDIT ** |
|||
|
|||
# TARGTYPE "Win32 (x86) Static Library" 0x0104 |
|||
|
|||
CFG=LgLibAdvantech - Win32 Debug |
|||
!MESSAGE This is not a valid makefile. To build this project using NMAKE, |
|||
!MESSAGE use the Export Makefile command and run |
|||
!MESSAGE |
|||
!MESSAGE NMAKE /f "LgLibAdvantech.mak". |
|||
!MESSAGE |
|||
!MESSAGE You can specify a configuration when running NMAKE |
|||
!MESSAGE by defining the macro CFG on the command line. For example: |
|||
!MESSAGE |
|||
!MESSAGE NMAKE /f "LgLibAdvantech.mak" CFG="LgLibAdvantech - Win32 Debug" |
|||
!MESSAGE |
|||
!MESSAGE Possible choices for configuration are: |
|||
!MESSAGE |
|||
!MESSAGE "LgLibAdvantech - Win32 Release" (based on "Win32 (x86) Static Library") |
|||
!MESSAGE "LgLibAdvantech - Win32 Debug" (based on "Win32 (x86) Static Library") |
|||
!MESSAGE |
|||
|
|||
# Begin Project |
|||
# PROP AllowPerConfigDependencies 0 |
|||
# PROP Scc_ProjName ""$/System/System", TRFAAAAA" |
|||
# PROP Scc_LocalPath "..\..\system" |
|||
CPP=cl.exe |
|||
RSC=rc.exe |
|||
|
|||
!IF "$(CFG)" == "LgLibAdvantech - Win32 Release" |
|||
|
|||
# PROP BASE Use_MFC 0 |
|||
# PROP BASE Use_Debug_Libraries 0 |
|||
# PROP BASE Output_Dir "Release" |
|||
# PROP BASE Intermediate_Dir "Release" |
|||
# PROP BASE Target_Dir "" |
|||
# PROP Use_MFC 0 |
|||
# PROP Use_Debug_Libraries 0 |
|||
# PROP Output_Dir "..\..\Intermediate\6\Release\LgLibAdvantech" |
|||
# PROP Intermediate_Dir "..\..\Intermediate\6\Release\LgLibAdvantech" |
|||
# PROP Target_Dir "" |
|||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Yu"stdafx.h" /FD /c |
|||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Yu"stdafx.h" /FD /c |
|||
# ADD BASE RSC /l 0x409 /d "NDEBUG" |
|||
# ADD RSC /l 0x409 /d "NDEBUG" |
|||
BSC32=bscmake.exe |
|||
# ADD BASE BSC32 /nologo |
|||
# ADD BSC32 /nologo |
|||
LIB32=link.exe -lib |
|||
# ADD BASE LIB32 /nologo |
|||
# ADD LIB32 /nologo /out:"..\..\Intermediate\6\LgLibAdvantech.lib" |
|||
|
|||
!ELSEIF "$(CFG)" == "LgLibAdvantech - Win32 Debug" |
|||
|
|||
# PROP BASE Use_MFC 0 |
|||
# PROP BASE Use_Debug_Libraries 1 |
|||
# PROP BASE Output_Dir "Debug" |
|||
# PROP BASE Intermediate_Dir "Debug" |
|||
# PROP BASE Target_Dir "" |
|||
# PROP Use_MFC 0 |
|||
# PROP Use_Debug_Libraries 1 |
|||
# PROP Output_Dir "..\..\Intermediate\6\Debug\LgLibAdvantech" |
|||
# PROP Intermediate_Dir "..\..\Intermediate\6\Debug\LgLibAdvantech" |
|||
# PROP Target_Dir "" |
|||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Yu"stdafx.h" /FD /GZ /c |
|||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Yu"stdafx.h" /FD /GZ /c |
|||
# ADD BASE RSC /l 0x409 /d "_DEBUG" |
|||
# ADD RSC /l 0x409 /d "_DEBUG" |
|||
BSC32=bscmake.exe |
|||
# ADD BASE BSC32 /nologo |
|||
# ADD BSC32 /nologo |
|||
LIB32=link.exe -lib |
|||
# ADD BASE LIB32 /nologo |
|||
# ADD LIB32 /nologo /out:"..\..\Intermediate\6\LgLibAdvantechD.lib" |
|||
|
|||
!ENDIF |
|||
|
|||
# Begin Target |
|||
|
|||
# Name "LgLibAdvantech - Win32 Release" |
|||
# Name "LgLibAdvantech - Win32 Debug" |
|||
# Begin Group "Source Files" |
|||
|
|||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\LgAdvantechDeviceEnumerator.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\LgAdvantechPCI1762.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\StdAfx.cpp |
|||
# ADD CPP /Yc"stdafx.h" |
|||
# End Source File |
|||
# End Group |
|||
# Begin Group "Header Files" |
|||
|
|||
# PROP Default_Filter "h;hpp;hxx;hm;inl" |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\LgAdvantechDeviceEnumerator.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\LgAdvantechPCI1762.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\StdAfx.h |
|||
# End Source File |
|||
# End Group |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\Readme.txt |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\ADSAPI\ADSAPI32.LIB |
|||
# End Source File |
|||
# End Target |
|||
# End Project |
|||
@ -0,0 +1,46 @@ |
|||
<html> |
|||
<body> |
|||
<pre> |
|||
<h1>Build Log</h1> |
|||
<h3> |
|||
--------------------Configuration: LgLibAdvantech - Win32 Debug-------------------- |
|||
</h3> |
|||
<h3>Command Lines</h3> |
|||
Creating temporary file "C:\Users\Evgeny\AppData\Local\Temp\RSP8022.tmp" with contents |
|||
[ |
|||
/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"..\..\Intermediate\6\Debug\LgLibAdvantech/LgLibAdvantech.pch" /Yu"stdafx.h" /Fo"..\..\Intermediate\6\Debug\LgLibAdvantech/" /Fd"..\..\Intermediate\6\Debug\LgLibAdvantech/" /FD /GZ /c |
|||
"C:\Sources\LgLib\Advantech\LgAdvantechDeviceEnumerator.cpp" |
|||
"C:\Sources\LgLib\Advantech\LgAdvantechPCI1762.cpp" |
|||
] |
|||
Creating command line "cl.exe @C:\Users\Evgeny\AppData\Local\Temp\RSP8022.tmp" |
|||
Creating temporary file "C:\Users\Evgeny\AppData\Local\Temp\RSP8023.tmp" with contents |
|||
[ |
|||
/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"..\..\Intermediate\6\Debug\LgLibAdvantech/LgLibAdvantech.pch" /Yc"stdafx.h" /Fo"..\..\Intermediate\6\Debug\LgLibAdvantech/" /Fd"..\..\Intermediate\6\Debug\LgLibAdvantech/" /FD /GZ /c |
|||
"C:\Sources\LgLib\Advantech\StdAfx.cpp" |
|||
] |
|||
Creating command line "cl.exe @C:\Users\Evgeny\AppData\Local\Temp\RSP8023.tmp" |
|||
Creating temporary file "C:\Users\Evgeny\AppData\Local\Temp\RSP8024.tmp" with contents |
|||
[ |
|||
/nologo /out:"..\..\Intermediate\6\LgLibAdvantechD.lib" |
|||
\Sources\Intermediate\6\Debug\LgLibAdvantech\LgAdvantechDeviceEnumerator.obj |
|||
\Sources\Intermediate\6\Debug\LgLibAdvantech\LgAdvantechPCI1762.obj |
|||
\Sources\Intermediate\6\Debug\LgLibAdvantech\StdAfx.obj |
|||
.\ADSAPI\ADSAPI32.LIB |
|||
] |
|||
Creating command line "link.exe -lib @C:\Users\Evgeny\AppData\Local\Temp\RSP8024.tmp" |
|||
<h3>Output Window</h3> |
|||
Compiling... |
|||
StdAfx.cpp |
|||
Compiling... |
|||
LgAdvantechDeviceEnumerator.cpp |
|||
LgAdvantechPCI1762.cpp |
|||
Generating Code... |
|||
Creating library... |
|||
|
|||
|
|||
|
|||
<h3>Results</h3> |
|||
LgLibAdvantechD.lib - 0 error(s), 0 warning(s) |
|||
</pre> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,273 @@ |
|||
<?xml version="1.0" encoding="Windows-1252"?> |
|||
<VisualStudioProject |
|||
ProjectType="Visual C++" |
|||
Version="8.00" |
|||
Name="LgLibAdvantech" |
|||
ProjectGUID="{E0C226E5-5902-4A5A-A17F-5C304C43DED9}" |
|||
> |
|||
<Platforms> |
|||
<Platform |
|||
Name="Win32" |
|||
/> |
|||
</Platforms> |
|||
<ToolFiles> |
|||
</ToolFiles> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
OutputDirectory=".\..\..\Intermediate\6\Debug\LgLibAdvantech" |
|||
IntermediateDirectory=".\..\..\Intermediate\6\Debug\LgLibAdvantech" |
|||
ConfigurationType="4" |
|||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" |
|||
UseOfMFC="0" |
|||
ATLMinimizesCRunTimeLibraryUsage="false" |
|||
CharacterSet="2" |
|||
> |
|||
<Tool |
|||
Name="VCPreBuildEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCustomBuildTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXMLDataGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCMIDLTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
Optimization="0" |
|||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB" |
|||
MinimalRebuild="true" |
|||
BasicRuntimeChecks="3" |
|||
RuntimeLibrary="3" |
|||
TreatWChar_tAsBuiltInType="false" |
|||
ForceConformanceInForLoopScope="false" |
|||
RuntimeTypeInfo="false" |
|||
UsePrecompiledHeader="2" |
|||
PrecompiledHeaderThrough="stdafx.h" |
|||
PrecompiledHeaderFile=".\..\..\Intermediate\6\Debug\LgLibAdvantech/LgLibAdvantech.pch" |
|||
AssemblerListingLocation=".\..\..\Intermediate\6\Debug\LgLibAdvantech/" |
|||
ObjectFile=".\..\..\Intermediate\6\Debug\LgLibAdvantech/" |
|||
ProgramDataBaseFileName=".\..\..\Intermediate\6\Debug\LgLibAdvantech/" |
|||
WarningLevel="3" |
|||
SuppressStartupBanner="true" |
|||
DebugInformationFormat="4" |
|||
/> |
|||
<Tool |
|||
Name="VCManagedResourceCompilerTool" |
|||
/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
PreprocessorDefinitions="_DEBUG" |
|||
Culture="1033" |
|||
/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
OutputFile="..\..\Intermediate\6\LgLibAdvantechD.lib" |
|||
SuppressStartupBanner="true" |
|||
/> |
|||
<Tool |
|||
Name="VCALinkTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXDCMakeTool" |
|||
/> |
|||
<Tool |
|||
Name="VCBscMakeTool" |
|||
SuppressStartupBanner="true" |
|||
OutputFile=".\..\..\Intermediate\6\Debug\LgLibAdvantech/LgLibAdvantech.bsc" |
|||
/> |
|||
<Tool |
|||
Name="VCFxCopTool" |
|||
/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool" |
|||
/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
OutputDirectory=".\..\..\Intermediate\6\Release\LgLibAdvantech" |
|||
IntermediateDirectory=".\..\..\Intermediate\6\Release\LgLibAdvantech" |
|||
ConfigurationType="4" |
|||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" |
|||
UseOfMFC="0" |
|||
ATLMinimizesCRunTimeLibraryUsage="false" |
|||
CharacterSet="2" |
|||
> |
|||
<Tool |
|||
Name="VCPreBuildEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCustomBuildTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXMLDataGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCMIDLTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
Optimization="2" |
|||
InlineFunctionExpansion="1" |
|||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB" |
|||
StringPooling="true" |
|||
RuntimeLibrary="0" |
|||
EnableFunctionLevelLinking="true" |
|||
TreatWChar_tAsBuiltInType="false" |
|||
ForceConformanceInForLoopScope="false" |
|||
RuntimeTypeInfo="false" |
|||
UsePrecompiledHeader="2" |
|||
PrecompiledHeaderThrough="stdafx.h" |
|||
PrecompiledHeaderFile=".\..\..\Intermediate\6\Release\LgLibAdvantech/LgLibAdvantech.pch" |
|||
AssemblerListingLocation=".\..\..\Intermediate\6\Release\LgLibAdvantech/" |
|||
ObjectFile=".\..\..\Intermediate\6\Release\LgLibAdvantech/" |
|||
ProgramDataBaseFileName=".\..\..\Intermediate\6\Release\LgLibAdvantech/" |
|||
WarningLevel="3" |
|||
SuppressStartupBanner="true" |
|||
/> |
|||
<Tool |
|||
Name="VCManagedResourceCompilerTool" |
|||
/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
PreprocessorDefinitions="NDEBUG" |
|||
Culture="1033" |
|||
/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
OutputFile="..\..\Intermediate\6\LgLibAdvantech.lib" |
|||
SuppressStartupBanner="true" |
|||
/> |
|||
<Tool |
|||
Name="VCALinkTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXDCMakeTool" |
|||
/> |
|||
<Tool |
|||
Name="VCBscMakeTool" |
|||
SuppressStartupBanner="true" |
|||
OutputFile=".\..\..\Intermediate\6\Release\LgLibAdvantech/LgLibAdvantech.bsc" |
|||
/> |
|||
<Tool |
|||
Name="VCFxCopTool" |
|||
/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool" |
|||
/> |
|||
</Configuration> |
|||
</Configurations> |
|||
<References> |
|||
</References> |
|||
<Files> |
|||
<Filter |
|||
Name="Source Files" |
|||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
|||
> |
|||
<File |
|||
RelativePath="LgAdvantechDeviceEnumerator.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="LgAdvantechPCI1762.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="StdAfx.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
UsePrecompiledHeader="1" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
UsePrecompiledHeader="1" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
</Filter> |
|||
<Filter |
|||
Name="Header Files" |
|||
Filter="h;hpp;hxx;hm;inl" |
|||
> |
|||
<File |
|||
RelativePath="LgAdvantechDeviceEnumerator.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="LgAdvantechPCI1762.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="StdAfx.h" |
|||
> |
|||
</File> |
|||
</Filter> |
|||
<File |
|||
RelativePath="ADSAPI\ADSAPI32.LIB" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="Readme.txt" |
|||
> |
|||
</File> |
|||
</Files> |
|||
<Globals> |
|||
</Globals> |
|||
</VisualStudioProject> |
|||
@ -0,0 +1,65 @@ |
|||
<?xml version="1.0" encoding="Windows-1252"?> |
|||
<VisualStudioUserFile |
|||
ProjectType="Visual C++" |
|||
Version="8.00" |
|||
ShowAllFiles="false" |
|||
> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
> |
|||
<DebugSettings |
|||
Command="" |
|||
WorkingDirectory="" |
|||
CommandArguments="" |
|||
Attach="false" |
|||
DebuggerType="3" |
|||
Remote="1" |
|||
RemoteMachine="DUALCORE" |
|||
RemoteCommand="" |
|||
HttpUrl="" |
|||
PDBPath="" |
|||
SQLDebugging="" |
|||
Environment="" |
|||
EnvironmentMerge="true" |
|||
DebuggerFlavor="" |
|||
MPIRunCommand="" |
|||
MPIRunArguments="" |
|||
MPIRunWorkingDirectory="" |
|||
ApplicationCommand="" |
|||
ApplicationArguments="" |
|||
ShimCommand="" |
|||
MPIAcceptMode="" |
|||
MPIAcceptFilter="" |
|||
/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
> |
|||
<DebugSettings |
|||
Command="" |
|||
WorkingDirectory="" |
|||
CommandArguments="" |
|||
Attach="false" |
|||
DebuggerType="3" |
|||
Remote="1" |
|||
RemoteMachine="DUALCORE" |
|||
RemoteCommand="" |
|||
HttpUrl="" |
|||
PDBPath="" |
|||
SQLDebugging="" |
|||
Environment="" |
|||
EnvironmentMerge="true" |
|||
DebuggerFlavor="" |
|||
MPIRunCommand="" |
|||
MPIRunArguments="" |
|||
MPIRunWorkingDirectory="" |
|||
ApplicationCommand="" |
|||
ApplicationArguments="" |
|||
ShimCommand="" |
|||
MPIAcceptMode="" |
|||
MPIAcceptFilter="" |
|||
/> |
|||
</Configuration> |
|||
</Configurations> |
|||
</VisualStudioUserFile> |
|||
@ -0,0 +1,65 @@ |
|||
<?xml version="1.0" encoding="windows-1255"?> |
|||
<VisualStudioUserFile |
|||
ProjectType="Visual C++" |
|||
Version="8.00" |
|||
ShowAllFiles="false" |
|||
> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
> |
|||
<DebugSettings |
|||
Command="" |
|||
WorkingDirectory="" |
|||
CommandArguments="" |
|||
Attach="false" |
|||
DebuggerType="3" |
|||
Remote="1" |
|||
RemoteMachine="P2600HT" |
|||
RemoteCommand="" |
|||
HttpUrl="" |
|||
PDBPath="" |
|||
SQLDebugging="" |
|||
Environment="" |
|||
EnvironmentMerge="true" |
|||
DebuggerFlavor="" |
|||
MPIRunCommand="" |
|||
MPIRunArguments="" |
|||
MPIRunWorkingDirectory="" |
|||
ApplicationCommand="" |
|||
ApplicationArguments="" |
|||
ShimCommand="" |
|||
MPIAcceptMode="" |
|||
MPIAcceptFilter="" |
|||
/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
> |
|||
<DebugSettings |
|||
Command="" |
|||
WorkingDirectory="" |
|||
CommandArguments="" |
|||
Attach="false" |
|||
DebuggerType="3" |
|||
Remote="1" |
|||
RemoteMachine="P2600HT" |
|||
RemoteCommand="" |
|||
HttpUrl="" |
|||
PDBPath="" |
|||
SQLDebugging="" |
|||
Environment="" |
|||
EnvironmentMerge="true" |
|||
DebuggerFlavor="" |
|||
MPIRunCommand="" |
|||
MPIRunArguments="" |
|||
MPIRunWorkingDirectory="" |
|||
ApplicationCommand="" |
|||
ApplicationArguments="" |
|||
ShimCommand="" |
|||
MPIAcceptMode="" |
|||
MPIAcceptFilter="" |
|||
/> |
|||
</Configuration> |
|||
</Configurations> |
|||
</VisualStudioUserFile> |
|||
@ -0,0 +1,150 @@ |
|||
<?xml version="1.0" encoding = "Windows-1252"?> |
|||
<VisualStudioProject |
|||
ProjectType="Visual C++" |
|||
Version="7.00" |
|||
Name="LgLibAdvantech" |
|||
SccProjectName="" |
|||
SccLocalPath=""> |
|||
<Platforms> |
|||
<Platform |
|||
Name="Win32"/> |
|||
</Platforms> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
OutputDirectory=".\..\..\Intermediate\7\Debug\LgLibAdvantech" |
|||
IntermediateDirectory=".\..\..\Intermediate\7\Debug\LgLibAdvantech" |
|||
ConfigurationType="4" |
|||
UseOfMFC="0" |
|||
ATLMinimizesCRunTimeLibraryUsage="FALSE" |
|||
CharacterSet="2"> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
Optimization="0" |
|||
PreprocessorDefinitions="WIN32,_DEBUG,_LIB" |
|||
BasicRuntimeChecks="3" |
|||
RuntimeLibrary="3" |
|||
UsePrecompiledHeader="3" |
|||
PrecompiledHeaderThrough="stdafx.h" |
|||
PrecompiledHeaderFile=".\..\..\Intermediate\7\Debug\LgLibAdvantech/LgLibAdvantech.pch" |
|||
AssemblerListingLocation=".\..\..\Intermediate\7\Debug\LgLibAdvantech/" |
|||
ObjectFile=".\..\..\Intermediate\7\Debug\LgLibAdvantech/" |
|||
ProgramDataBaseFileName=".\..\..\Intermediate\7\Debug\LgLibAdvantech/" |
|||
WarningLevel="3" |
|||
SuppressStartupBanner="TRUE" |
|||
DebugInformationFormat="4"/> |
|||
<Tool |
|||
Name="VCCustomBuildTool"/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
OutputFile="..\..\Intermediate\7\LgLibAdvantechD.lib" |
|||
SuppressStartupBanner="TRUE"/> |
|||
<Tool |
|||
Name="VCMIDLTool"/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool"/> |
|||
<Tool |
|||
Name="VCPreBuildEventTool"/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool"/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
PreprocessorDefinitions="_DEBUG" |
|||
Culture="1033"/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool"/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
OutputDirectory=".\..\..\Intermediate\7\Release\LgLibAdvantech" |
|||
IntermediateDirectory=".\..\..\Intermediate\7\Release\LgLibAdvantech" |
|||
ConfigurationType="4" |
|||
UseOfMFC="0" |
|||
ATLMinimizesCRunTimeLibraryUsage="FALSE" |
|||
CharacterSet="2"> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
InlineFunctionExpansion="1" |
|||
PreprocessorDefinitions="WIN32,NDEBUG,_LIB" |
|||
StringPooling="TRUE" |
|||
RuntimeLibrary="0" |
|||
EnableFunctionLevelLinking="TRUE" |
|||
UsePrecompiledHeader="3" |
|||
PrecompiledHeaderThrough="stdafx.h" |
|||
PrecompiledHeaderFile=".\..\..\Intermediate\7\Release\LgLibAdvantech/LgLibAdvantech.pch" |
|||
AssemblerListingLocation=".\..\..\Intermediate\7\Release\LgLibAdvantech/" |
|||
ObjectFile=".\..\..\Intermediate\7\Release\LgLibAdvantech/" |
|||
ProgramDataBaseFileName=".\..\..\Intermediate\7\Release\LgLibAdvantech/" |
|||
WarningLevel="3" |
|||
SuppressStartupBanner="TRUE"/> |
|||
<Tool |
|||
Name="VCCustomBuildTool"/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
OutputFile="..\..\Intermediate\7\LgLibAdvantech.lib" |
|||
SuppressStartupBanner="TRUE"/> |
|||
<Tool |
|||
Name="VCMIDLTool"/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool"/> |
|||
<Tool |
|||
Name="VCPreBuildEventTool"/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool"/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
PreprocessorDefinitions="NDEBUG" |
|||
Culture="1033"/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool"/> |
|||
</Configuration> |
|||
</Configurations> |
|||
<Files> |
|||
<Filter |
|||
Name="Source Files" |
|||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> |
|||
<File |
|||
RelativePath=".\LgAdvantechDeviceEnumerator.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\LgAdvantechPCI1762.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\StdAfx.cpp"> |
|||
<FileConfiguration |
|||
Name="Debug|Win32"> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
UsePrecompiledHeader="1"/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32"> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
UsePrecompiledHeader="1"/> |
|||
</FileConfiguration> |
|||
</File> |
|||
</Filter> |
|||
<Filter |
|||
Name="Header Files" |
|||
Filter="h;hpp;hxx;hm;inl"> |
|||
<File |
|||
RelativePath=".\LgAdvantechDeviceEnumerator.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\LgAdvantechPCI1762.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\StdAfx.h"> |
|||
</File> |
|||
</Filter> |
|||
<File |
|||
RelativePath=".\ADSAPI\ADSAPI32.LIB"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\Readme.txt"> |
|||
</File> |
|||
</Files> |
|||
<Globals> |
|||
</Globals> |
|||
</VisualStudioProject> |
|||
@ -0,0 +1,10 @@ |
|||
"" |
|||
{ |
|||
"FILE_VERSION" = "9237" |
|||
"ENLISTMENT_CHOICE" = "NEVER" |
|||
"PROJECT_FILE_RELATIVE_PATH" = "relative:LgLib\\Advantech" |
|||
"NUMBER_OF_EXCLUDED_FILES" = "0" |
|||
"ORIGINAL_PROJECT_FILE_PATH" = "" |
|||
"NUMBER_OF_NESTED_PROJECTS" = "0" |
|||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" |
|||
} |
|||
@ -0,0 +1,152 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Template|Win32"> |
|||
<Configuration>Template</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<SccProjectName>"$/System/System", TRFAAAAA</SccProjectName> |
|||
<SccLocalPath>..\..\system</SccLocalPath> |
|||
<ProjectGuid>{61AF98E7-9A3D-4149-90C0-222DB4D5D6F9}</ProjectGuid> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<PlatformToolset>v142</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<PlatformToolset>v142</PlatformToolset> |
|||
<UseOfMfc>false</UseOfMfc> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<PlatformToolset>v142</PlatformToolset> |
|||
<UseOfMfc>false</UseOfMfc> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<OutDir>.\..\..\Intermediate\6\Release\LgLibAdvantech\</OutDir> |
|||
<IntDir>.\..\..\Intermediate\6\Release\LgLibAdvantech\</IntDir> |
|||
<LinkIncremental>false</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<OutDir>.\..\..\Intermediate\6\Debug\LgLibAdvantech\</OutDir> |
|||
<IntDir>.\..\..\Intermediate\6\Debug\LgLibAdvantech\</IntDir> |
|||
<LinkIncremental>true</LinkIncremental> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<InlineFunctionExpansion>Default</InlineFunctionExpansion> |
|||
<StringPooling>true</StringPooling> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<AssemblerListingLocation>.\..\..\Intermediate\6\Release\LgLibAdvantech\</AssemblerListingLocation> |
|||
<PrecompiledHeaderOutputFile>.\..\..\Intermediate\6\Release\LgLibAdvantech\LgLibAdvantech.pch</PrecompiledHeaderOutputFile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile> |
|||
<ObjectFileName>.\..\..\Intermediate\6\Release\LgLibAdvantech\</ObjectFileName> |
|||
<ProgramDataBaseFileName>.\..\..\Intermediate\6\Release\LgLibAdvantech\</ProgramDataBaseFileName> |
|||
</ClCompile> |
|||
<ResourceCompile> |
|||
<Culture>0x0409</Culture> |
|||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
</ResourceCompile> |
|||
<Bscmake> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<OutputFile>.\..\..\Intermediate\6\Release\LgLibAdvantech\LgLibAdvantech.bsc</OutputFile> |
|||
</Bscmake> |
|||
<Lib> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<OutputFile>..\..\Intermediate\6\LgLibAdvantech.lib</OutputFile> |
|||
</Lib> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> |
|||
<InlineFunctionExpansion>Default</InlineFunctionExpansion> |
|||
<FunctionLevelLinking> |
|||
</FunctionLevelLinking> |
|||
<Optimization>Disabled</Optimization> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<MinimalRebuild> |
|||
</MinimalRebuild> |
|||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<AssemblerListingLocation>.\..\..\Intermediate\6\Debug\LgLibAdvantech\</AssemblerListingLocation> |
|||
<PrecompiledHeaderOutputFile>.\..\..\Intermediate\6\Debug\LgLibAdvantech\LgLibAdvantech.pch</PrecompiledHeaderOutputFile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile> |
|||
<ObjectFileName>.\..\..\Intermediate\6\Debug\LgLibAdvantech\</ObjectFileName> |
|||
<ProgramDataBaseFileName>.\..\..\Intermediate\6\Debug\LgLibAdvantech\</ProgramDataBaseFileName> |
|||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
|||
</ClCompile> |
|||
<ResourceCompile> |
|||
<Culture>0x0409</Culture> |
|||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
</ResourceCompile> |
|||
<Bscmake> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<OutputFile>.\..\..\Intermediate\6\Debug\LgLibAdvantech\LgLibAdvantech.bsc</OutputFile> |
|||
</Bscmake> |
|||
<Lib> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<OutputFile>..\..\Intermediate\6\LgLibAdvantechD.lib</OutputFile> |
|||
</Lib> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="LgAdvantechDeviceEnumerator.cpp" /> |
|||
<ClCompile Include="LgAdvantechPCI1762.cpp" /> |
|||
<ClCompile Include="StdAfx.cpp"> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdafx.h</PrecompiledHeaderFile> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdafx.h</PrecompiledHeaderFile> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="LgAdvantechDeviceEnumerator.h" /> |
|||
<ClInclude Include="LgAdvantechPCI1762.h" /> |
|||
<ClInclude Include="StdAfx.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Text Include="Readme.txt" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Library Include="ADSAPI\ADSAPI32.LIB" /> |
|||
</ItemGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
|||
@ -0,0 +1,41 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<Filter Include="Source Files"> |
|||
<UniqueIdentifier>{afbd0ce3-e5a4-4100-b061-079068692ec2}</UniqueIdentifier> |
|||
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions> |
|||
</Filter> |
|||
<Filter Include="Header Files"> |
|||
<UniqueIdentifier>{fd4786db-a141-4590-8f05-494018f017bc}</UniqueIdentifier> |
|||
<Extensions>h;hpp;hxx;hm;inl</Extensions> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="LgAdvantechDeviceEnumerator.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="LgAdvantechPCI1762.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="StdAfx.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="LgAdvantechDeviceEnumerator.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="LgAdvantechPCI1762.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="StdAfx.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Text Include="Readme.txt" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Library Include="ADSAPI\ADSAPI32.LIB" /> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,3 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
</Project> |
|||
@ -0,0 +1,19 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: StdAfx.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of StdAfx.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
|||
// LgLibAdvantech.pch will be the pre-compiled header
|
|||
// stdafx.obj will contain the pre-compiled type information
|
|||
|
|||
#include "stdafx.h"
|
|||
|
|||
@ -0,0 +1,30 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: StdAfx.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of StdAfx.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __STD__AFX__H__INCLUDED__ |
|||
#define __STD__AFX__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif |
|||
|
|||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers |
|||
|
|||
#include <windows.h> |
|||
#include <tchar.h> |
|||
#include <stdio.h> |
|||
#include <malloc.h> |
|||
#include "..\..\LgLib\LgLogger.h" |
|||
|
|||
//{{AFX_INSERT_LOCATION}} |
|||
#endif |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,232 @@ |
|||
10 |
|||
|
|||
dir |
|||
4 |
|||
file:///C:/svn/Laserguard/LgLib/Advantech/adsapi/include |
|||
file:///C:/svn |
|||
|
|||
|
|||
|
|||
2011-01-31T18:09:49.891625Z |
|||
1 |
|||
Gagua |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
ebbf8f96-fc2e-ba4e-9c80-fda699942c68 |
|||
|
|||
vssver.scc |
|||
file |
|||
|
|||
|
|||
|
|||
|
|||
2011-02-01T11:06:48.984375Z |
|||
51baa7074e453018bb0272f3a3f185e2 |
|||
2011-01-31T18:09:49.891625Z |
|||
1 |
|||
Gagua |
|||
has-props |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
112 |
|||
|
|||
dnet.h |
|||
file |
|||
|
|||
|
|||
|
|||
|
|||
2011-02-01T11:06:49.015625Z |
|||
d9c849d4114c2f185a92ce3999aaedaf |
|||
2011-01-31T18:09:49.891625Z |
|||
1 |
|||
Gagua |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
8267 |
|||
|
|||
comm.h |
|||
file |
|||
|
|||
|
|||
|
|||
|
|||
2011-02-01T11:06:49.015625Z |
|||
06bf1a8ac8f7e5b44a10002a9fb664db |
|||
2011-01-31T18:09:49.891625Z |
|||
1 |
|||
Gagua |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
1425 |
|||
|
|||
driver.h |
|||
file |
|||
|
|||
|
|||
|
|||
|
|||
2011-02-01T11:06:49.015625Z |
|||
9d1f031e926a5f6f3fd0392df7beab32 |
|||
2011-01-31T18:09:49.891625Z |
|||
1 |
|||
Gagua |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
88663 |
|||
|
|||
device.h |
|||
file |
|||
|
|||
|
|||
|
|||
|
|||
2011-02-01T11:06:49.031250Z |
|||
0cbb0e9b1acea561cab25ded4342a700 |
|||
2011-01-31T18:09:49.891625Z |
|||
1 |
|||
Gagua |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
11583 |
|||
|
|||
os.h |
|||
file |
|||
|
|||
|
|||
|
|||
|
|||
2011-02-01T11:06:49.031250Z |
|||
1c76025bd1872cc01b25fbb52fa5385b |
|||
2011-01-31T18:09:49.891625Z |
|||
1 |
|||
Gagua |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
558 |
|||
|
|||
@ -0,0 +1,5 @@ |
|||
K 13 |
|||
svn:mime-type |
|||
V 24 |
|||
application/octet-stream |
|||
END |
|||
@ -0,0 +1,37 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: COMM.H |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of COMM.H |
|||
//---------------------------------------------------------------------------- |
|||
#define FLOAT float |
|||
#define CHAR char |
|||
#define USHORT unsigned short |
|||
#define SHORT short |
|||
#define ULONG unsigned long |
|||
|
|||
#define MaxErrMsgLen 80 // Max Error Message Length |
|||
//#define BD_DN5017 (0x4e) // ADAM 5017 |
|||
//#define BD_DN5018 (0x4f) // ADAM 5018 |
|||
//#define BD_DN5024 (0x50) // ADAM 5024 |
|||
//#define BD_DN5051 (0x51) // ADAM 5051 |
|||
//#define BD_DN5056 (0x52) // ADAM 5056 |
|||
//#define BD_DN5060 (0x53) // ADAM 5060 |
|||
|
|||
#define GetErrorCode(n) ((UINT)(n & 0x0000FFFF)) |
|||
#define GetBaseAddr(n) ((int)((n & 0x0FFF0000) >> 16)) |
|||
#define GetComPort(n) ((int)((n & 0xF0000000) >> 28)) |
|||
|
|||
static void AddControlString(HWND); |
|||
static void SetHardwareSettings(HWND); |
|||
static void GetHardwareSettings(HWND); |
|||
static float Power(int,int); |
|||
static DWORD StringToDec(char far *,int); |
|||
static void GetErrorMessage(LRESULT lError,LPSTR lpszErrMsg); |
|||
@ -0,0 +1,255 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: DEVICE.H |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of DEVICE.H |
|||
//---------------------------------------------------------------------------- |
|||
/*************************************************************************** |
|||
Module Name: DEVICE.H |
|||
Purpose: the declaration of functions, data structures, status codes, |
|||
constants, and messages |
|||
Version: 1.00 |
|||
Date: 10/01/1996 |
|||
Copyright (c) 1996 Advantech Corp. Ltd. |
|||
All rights reserved. |
|||
****************************************************************************/ |
|||
|
|||
#ifndef _INC_DEVICE |
|||
#define _INC_DEVICE |
|||
|
|||
#include "OS.H" |
|||
#include "DRIVER.H" |
|||
|
|||
#ifdef _WIN31 |
|||
#define FLOAT float |
|||
#define CHAR char |
|||
#define USHORT unsigned short |
|||
#define ULONG unsigned long |
|||
#endif |
|||
#ifdef __cplusplus |
|||
extern "C" |
|||
{ |
|||
#endif |
|||
|
|||
#define PUBLIC extern |
|||
#define PRIVATE static |
|||
|
|||
/************************************************************************** |
|||
Device Configuration Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_ALL |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usChanConfig; // 0-single ended, 1-differential |
|||
USHORT usGainCtrMode; // 1-by jumper, 0-programmable |
|||
USHORT usPolarity; // 0-bipolar, 1-unipolar |
|||
USHORT usDasGain; // not used if GainCtrMode = 1 |
|||
USHORT usNumExpChan; // attached expansion channels |
|||
USHORT usCjcChannel; // cold junction channel |
|||
DAUGHTERSET Daughter[MAX_DAUGHTER_NUM]; // expansion board settings |
|||
AOSET AoSettings[MAX_AO_RANGE]; // analog output settings |
|||
WORD wDigPortCfg[MAX_DIO_PORT]; // port configuration for input or output |
|||
WORD wDigGroupCfg[MAX_DIO_PORT]; // port Group configuration |
|||
} DEVCONFIG_ALL, FAR * LPDEVCONFIG_ALL; |
|||
|
|||
/************************************************************************** |
|||
Device Configuration Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_AD |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usChanConfig; // 0-single ended, 1-differential |
|||
USHORT usGainCtrMode; // 1-by jumper, 0-programmable |
|||
USHORT usPolarity; // 0-bipolar, 1-unipolar |
|||
USHORT usDasGain; // not used if GainCtrMode = 1 |
|||
USHORT usNumExpChan; // attached expansion channels |
|||
USHORT usCjcChannel; // cold junction channel |
|||
DAUGHTERSET Daughter[MAX_DAUGHTER_NUM]; // expansion board settings |
|||
AOSET AoSettings[MAX_AO_RANGE]; // analog output settings |
|||
} DEVCONFIG_AD, FAR * LPDEVCONFIG_AD; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_AO Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_AO |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
AOSET AoSettings[MAX_AO_RANGE]; // analog output settings |
|||
} DEVCONFIG_AO, FAR * LPDEVCONFIG_AO; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_DIO Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_DIO |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
WORD wDigPortCfg[MAX_DIO_PORT]; // port configuration for input or output |
|||
WORD wDigGroupCfg[MAX_DIO_PORT]; // port Group configuration |
|||
} DEVCONFIG_DIO, FAR * LPDEVCONFIG_DIO; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_ADAM Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_ADAM |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usDelay; // delay time before reading response; unit-ms |
|||
USHORT usTimeOut; // time out for reading response; unit-ms |
|||
USHORT usRetry; // retry |
|||
USHORT usAlarmEnabled; // 0-disable, 1-enabled |
|||
USHORT usSlotNo; // slot number |
|||
USHORT usChecksumEnabled; // checksum enabled |
|||
USHORT usDataFormat; // 0-Dec, 2-Hex; for 5080 |
|||
USHORT usCounterMode; // 0-counter mode 0; 1-counter mode 1; 2-freq mode |
|||
CHAR szPreamble[20]; // prefix strings |
|||
CHAR szPostamble[20]; // postfix strings |
|||
} DEVCONFIG_ADAM, FAR * LPDEVCONFIG_ADAM; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_DEVNET Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_DEVNET |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDelayTime; // EPR |
|||
USHORT usAlarmEnabled; // 0-disable, 1-enabled |
|||
DWORD dwMemoryAddress; // beginning address of memory mapped IO to be controlled |
|||
DWORD dwMemoryCount; // number of bytes to be controlled |
|||
USHORT usMyMacID; // host MAC ID |
|||
USHORT usBaudRate; // baud rate |
|||
USHORT usPortNum; // port number |
|||
USHORT usSlotNo; // slot number |
|||
USHORT usMacID; // MAC ID |
|||
USHORT usEventEnabled; // 0-disable, 1-enabled |
|||
CHAR APEventName[15]; // Event name |
|||
HANDLE hEventAP; // Event handle |
|||
WORD wStatus; // status of single slot (device) |
|||
} DEVCONFIG_DEVNET, FAR * LPDEVCONFIG_DEVNET; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_QCOUNTER Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_QCOUNTER |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usCascadeMode; // Cascade Mode ,=0 no cascade, =1 cascade |
|||
USHORT usTimeBase; // Timer Latch setting for time base |
|||
USHORT usTimeDivider; // Timer Latch setting for time divider |
|||
} DEVCONFIG_QCOUNTER, FAR * LPDEVCONFIG_QCOUNTER; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_836 Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_836 |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usCountEdge; // =0 Positive, =1 Negative |
|||
USHORT usFilterEnabled; // 0-disable, 1-enable |
|||
DWORD dwMaxInFreq; // Max input frequency in Hz |
|||
} DEVCONFIG_836, FAR * LPDEVCONFIG_836; |
|||
|
|||
/************************************************************************** |
|||
Direct I/O Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_IO |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
CHAR szDescription[50]; // Description |
|||
} DEVCONFIG_IO, FAR * LPDEVCONFIG_IO; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_175X Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_175X |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usCardNo; // card no of this series |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usIntMode; // divide two parts, 0XBB0XAA (8 bits) |
|||
// this bit 7 and 3 fixed to zero |
|||
// the meant of BB port1 mode |
|||
// the meant of AA port0 mode |
|||
// bit 6 is port 1 interrupt trigger edge |
|||
// bit 2 is port 0 interrupt trigger edge |
|||
// (= 1 Rising, = 0 falling) |
|||
USHORT usCascadeMode; // cascade Mode ,=0 no cascade, =1 cascade |
|||
DWORD dwTimer1Count; // timer1 (hi is Counter1, lo is Counter0) |
|||
USHORT dwCounter2Count; // counter 2 count value |
|||
WORD wDigPortCfg[MAX_DIO_PORT]; // port configuration for input or output |
|||
} DEVCONFIG_175X, FAR * LPDEVCONFIG_175X; |
|||
|
|||
typedef struct _AD_WRITE_INPUT { |
|||
ULONG PortNumber; // Port # to write to |
|||
union { // Data to be output to port |
|||
ULONG LongData; |
|||
USHORT ShortData; |
|||
UCHAR CharData; |
|||
}; |
|||
} AD_WRITE_INPUT; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_SIMU Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_SIMU |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usSimulate; // 1: Simulate IO |
|||
USHORT usDataType; // 0: Float, 1: Long, 2:Byte |
|||
} DEVCONFIG_SIMU, FAR * LPDEVCONFIG_SIMU; |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,197 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: DNET.H |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of DNET.H |
|||
//---------------------------------------------------------------------------- |
|||
#include "..\include\driver.h" |
|||
#ifndef _INC_DNET |
|||
#define _INC_DNET |
|||
|
|||
#ifdef __cplusplus |
|||
//FEXPORT "C" |
|||
extern "C" |
|||
{ |
|||
#endif |
|||
|
|||
#define PORTNUM 11 |
|||
|
|||
#define SUCCESS 0 |
|||
#define DnetInitFailed 1 |
|||
#define DnetSendMsgFailed 2 |
|||
#define DnetRunOutOfMsgID 3 |
|||
#define DnetInvalidInputParam 4 |
|||
#define DnetErrorResponse 5 |
|||
#define DnetNoResponse 6 |
|||
#define DnetBusyOnNetwork 7 |
|||
#define DnetUnknownResponse 8 |
|||
#define DnetNotEnoughBuffer 9 |
|||
#define DnetFragResponseError 10 |
|||
#define DnetTooMuchDataAck 11 |
|||
#define DnetFragRequestError 12 |
|||
#define DnetEnableEventError 13 |
|||
#define DnetCreateOrOpenEventError 14 |
|||
#define DnetIORequestError 15 |
|||
#define DnetGetEventNameError 16 |
|||
#define DnetTimeOutError 17 |
|||
#define DnetOpenFailed 18 |
|||
#define DnetCloseFailed 19 |
|||
#define DnetResetFailed 20 |
|||
#define DnetConfigDataLost 21 |
|||
#define DnetBusOffError 22 |
|||
#define DnetInvalidMsgID 23 |
|||
#define DnetSetEPRFailed 24 |
|||
#define DnetDuplicateMacIDCheckFailed 25 |
|||
#define DnetWaitMsgFailed 26 |
|||
#define DnetGroup2MsgReceive 27 |
|||
#define DnetCheckEventFailed 28 |
|||
#define DnetCheckEventTimeOut 29 |
|||
#define DnetDataOverrunError 30 |
|||
|
|||
#define SC_GET_ATTRIB_ALL 1 |
|||
#define SC_SET_ATTRIB_ALL 2 |
|||
#define SC_RESET 5 |
|||
#define SC_START 6 |
|||
#define SC_STOP 7 |
|||
#define SC_CREATE 8 |
|||
#define SC_DELETE 9 |
|||
#define SC_APPLY_ATTRIB 13 |
|||
#define SC_GET_ATTRIB_SINGLE 14 |
|||
#define SC_SET_ATTRIB_SINGLE 16 |
|||
#define SC_FIND_NEXT_OBJECT_INST 17 |
|||
#define SC_ERROR_RESPONSE 20 |
|||
#define SC_DNRESTORE 21 |
|||
#define SC_SAVE 22 |
|||
#define SC_NO_OPERATION 23 |
|||
#define SC_UCMM_OPEN_REQUEST 75 |
|||
#define SC_UCMM_CLOSE_REQUEST 76 |
|||
|
|||
typedef struct tagCNXINFO |
|||
{ |
|||
WORD Port; // port number 0 or 1 |
|||
unsigned short grp; // message group |
|||
unsigned short id; // destination MAC ID |
|||
unsigned short pid; // producer ID |
|||
unsigned short cid; // consumer ID |
|||
unsigned char format; // message body format |
|||
unsigned short EPR; // expected packet rate |
|||
unsigned short ConnInst; // connection instance ID |
|||
unsigned short size; // data size |
|||
unsigned char data[512]; // data buffer |
|||
} S_CNXINFO; |
|||
|
|||
typedef struct tagS_MSG |
|||
{ |
|||
unsigned char grp; // message group |
|||
unsigned short id; // MAC ID |
|||
unsigned char msg; // message ID |
|||
unsigned char data[512]; // data body (fragment/non-fragment) |
|||
unsigned short len; // data length |
|||
} S_MSG; |
|||
|
|||
typedef struct tagALMSTATUS |
|||
{ |
|||
BOOL LoState; // low alarm state |
|||
BOOL HiState; // high alarm state |
|||
} S_ALMSTATUS; |
|||
|
|||
typedef struct tagEVENTDATA |
|||
{ |
|||
WORD Port; |
|||
WORD MacID; |
|||
CHAR Data[8]; |
|||
int Type; |
|||
} S_EVENTDATA, FAR * LPS_EVENTDATA; |
|||
|
|||
FEXPORT LRESULT FAR PASCAL DNOpen(WORD,WORD FAR *,WORD FAR *,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNClose(WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNInit(WORD,WORD,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNReset(WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNSetTimeout(WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNAllocateGrpMsg(WORD,WORD,WORD,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNFreeGrpMsg(WORD,WORD,WORD,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNUcmmOpenReq(WORD,WORD,WORD,WORD,WORD,WORD, |
|||
S_CNXINFO FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNUcmmCloseReq(S_CNXINFO FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetAttrib(S_CNXINFO FAR *,WORD,WORD,WORD, |
|||
unsigned char FAR *,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAttrib(S_CNXINFO FAR *,WORD,WORD,WORD, |
|||
unsigned char FAR *,WORD,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSendEXPReq(S_CNXINFO FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNGetEXPRsp(S_CNXINFO FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetEventEnabled(int,WORD,WORD,CHAR FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNGetEventData(WORD FAR *,WORD FAR *,int *,CHAR FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAi(S_CNXINFO FAR *,int,float FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetCJC(S_CNXINFO FAR *,int,float FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetChanMask(S_CNXINFO FAR *,int,WORD FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetChanMask(S_CNXINFO FAR *,int,WORD FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAo(S_CNXINFO FAR *,int,float FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetAo(S_CNXINFO FAR *,int,float FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAoStart(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetAoStart(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetDo(S_CNXINFO FAR *,int,WORD FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetDi(S_CNXINFO FAR *,int,WORD FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetDo(S_CNXINFO FAR *,int,WORD FAR *,int,int, |
|||
WORD Type); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAlarmState(S_CNXINFO FAR *,int, |
|||
S_ALMSTATUS FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetHiAlarm(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetLoAlarm(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetAlarmEnabled(S_CNXINFO FAR *,int, |
|||
WORD FAR *,WORD FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetHiAlarm(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetLoAlarm(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAlarmEnabled(S_CNXINFO FAR *,int, |
|||
WORD FAR *,WORD FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGet5kVersion(S_CNXINFO FAR *, |
|||
unsigned short FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetEPR(S_CNXINFO FAR *,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGet5kType(S_CNXINFO FAR *,int,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetHz(S_CNXINFO FAR *,int,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGetHz(S_CNXINFO FAR *,int,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetRange(S_CNXINFO FAR *,int,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGetSlew(S_CNXINFO FAR *,int,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetSlew(S_CNXINFO FAR *,int,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGetRange(S_CNXINFO FAR *,int,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSpanCali(S_CNXINFO FAR *,int); |
|||
FEXPORT LRESULT FAR PASCAL DNZeroCali(S_CNXINFO FAR *,int); |
|||
FEXPORT LRESULT FAR PASCAL DNCJCCali(S_CNXINFO FAR *,int,float); |
|||
FEXPORT LRESULT FAR PASCAL DNAO4mACali(S_CNXINFO FAR *,int,int,float); |
|||
FEXPORT LRESULT FAR PASCAL DNAO20mACali(S_CNXINFO FAR *,int,int,float); |
|||
FEXPORT LRESULT FAR PASCAL DNetResetConnection(WORD, WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNetGetIOReqAndRsp(WORD,S_EVENTDATA far *); |
|||
// Retrieve from Adapi32 & Registry for Devnet API example |
|||
FEXPORT LRESULT FAR PASCAL DNDeviceGetParamOfReg(WORD, USHORT FAR *, |
|||
DWORD FAR *, USHORT FAR *, |
|||
USHORT FAR *,USHORT FAR *, |
|||
USHORT FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNDeviceGetNumOfList(SHORT far *NumOfDevices); |
|||
FEXPORT LRESULT FAR PASCAL DNDeviceGetList(DEVLIST far *DeviceList, |
|||
SHORT MaxEntries, SHORT far *OutEntries); |
|||
FEXPORT LRESULT FAR PASCAL DNDeviceGetSubList(DWORD DeviceNum, |
|||
DEVLIST far *SubDevList, SHORT MaxEntries, |
|||
SHORT far *OutEntries); |
|||
FEXPORT LRESULT FAR PASCAL DNNodeReset(WORD,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNEnableEvent(WORD,WORD,BOOL); |
|||
FEXPORT LRESULT FAR PASCAL DNCheckEvent(WORD,DWORD); |
|||
//1999_5_17 |
|||
FEXPORT LRESULT FAR PASCAL DNCheckDuplicatedMacID(WORD,WORD); |
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
#endif |
|||
2042
PC_104/LgLib/Advantech/adsapi/include/.svn/text-base/driver.h.svn-base
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,21 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: OS.H |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of OS.H |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef _INC_OS |
|||
#define _INC_OS |
|||
|
|||
//#define _WINNT 1 |
|||
//#define _WIN31 1 |
|||
//#define _WIN95 1 |
|||
|
|||
#endif |
|||
Binary file not shown.
@ -0,0 +1,37 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: COMM.H |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of COMM.H |
|||
//---------------------------------------------------------------------------- |
|||
#define FLOAT float |
|||
#define CHAR char |
|||
#define USHORT unsigned short |
|||
#define SHORT short |
|||
#define ULONG unsigned long |
|||
|
|||
#define MaxErrMsgLen 80 // Max Error Message Length |
|||
//#define BD_DN5017 (0x4e) // ADAM 5017 |
|||
//#define BD_DN5018 (0x4f) // ADAM 5018 |
|||
//#define BD_DN5024 (0x50) // ADAM 5024 |
|||
//#define BD_DN5051 (0x51) // ADAM 5051 |
|||
//#define BD_DN5056 (0x52) // ADAM 5056 |
|||
//#define BD_DN5060 (0x53) // ADAM 5060 |
|||
|
|||
#define GetErrorCode(n) ((UINT)(n & 0x0000FFFF)) |
|||
#define GetBaseAddr(n) ((int)((n & 0x0FFF0000) >> 16)) |
|||
#define GetComPort(n) ((int)((n & 0xF0000000) >> 28)) |
|||
|
|||
static void AddControlString(HWND); |
|||
static void SetHardwareSettings(HWND); |
|||
static void GetHardwareSettings(HWND); |
|||
static float Power(int,int); |
|||
static DWORD StringToDec(char far *,int); |
|||
static void GetErrorMessage(LRESULT lError,LPSTR lpszErrMsg); |
|||
@ -0,0 +1,255 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: DEVICE.H |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of DEVICE.H |
|||
//---------------------------------------------------------------------------- |
|||
/*************************************************************************** |
|||
Module Name: DEVICE.H |
|||
Purpose: the declaration of functions, data structures, status codes, |
|||
constants, and messages |
|||
Version: 1.00 |
|||
Date: 10/01/1996 |
|||
Copyright (c) 1996 Advantech Corp. Ltd. |
|||
All rights reserved. |
|||
****************************************************************************/ |
|||
|
|||
#ifndef _INC_DEVICE |
|||
#define _INC_DEVICE |
|||
|
|||
#include "OS.H" |
|||
#include "DRIVER.H" |
|||
|
|||
#ifdef _WIN31 |
|||
#define FLOAT float |
|||
#define CHAR char |
|||
#define USHORT unsigned short |
|||
#define ULONG unsigned long |
|||
#endif |
|||
#ifdef __cplusplus |
|||
extern "C" |
|||
{ |
|||
#endif |
|||
|
|||
#define PUBLIC extern |
|||
#define PRIVATE static |
|||
|
|||
/************************************************************************** |
|||
Device Configuration Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_ALL |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usChanConfig; // 0-single ended, 1-differential |
|||
USHORT usGainCtrMode; // 1-by jumper, 0-programmable |
|||
USHORT usPolarity; // 0-bipolar, 1-unipolar |
|||
USHORT usDasGain; // not used if GainCtrMode = 1 |
|||
USHORT usNumExpChan; // attached expansion channels |
|||
USHORT usCjcChannel; // cold junction channel |
|||
DAUGHTERSET Daughter[MAX_DAUGHTER_NUM]; // expansion board settings |
|||
AOSET AoSettings[MAX_AO_RANGE]; // analog output settings |
|||
WORD wDigPortCfg[MAX_DIO_PORT]; // port configuration for input or output |
|||
WORD wDigGroupCfg[MAX_DIO_PORT]; // port Group configuration |
|||
} DEVCONFIG_ALL, FAR * LPDEVCONFIG_ALL; |
|||
|
|||
/************************************************************************** |
|||
Device Configuration Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_AD |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usChanConfig; // 0-single ended, 1-differential |
|||
USHORT usGainCtrMode; // 1-by jumper, 0-programmable |
|||
USHORT usPolarity; // 0-bipolar, 1-unipolar |
|||
USHORT usDasGain; // not used if GainCtrMode = 1 |
|||
USHORT usNumExpChan; // attached expansion channels |
|||
USHORT usCjcChannel; // cold junction channel |
|||
DAUGHTERSET Daughter[MAX_DAUGHTER_NUM]; // expansion board settings |
|||
AOSET AoSettings[MAX_AO_RANGE]; // analog output settings |
|||
} DEVCONFIG_AD, FAR * LPDEVCONFIG_AD; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_AO Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_AO |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
AOSET AoSettings[MAX_AO_RANGE]; // analog output settings |
|||
} DEVCONFIG_AO, FAR * LPDEVCONFIG_AO; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_DIO Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_DIO |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
WORD wDigPortCfg[MAX_DIO_PORT]; // port configuration for input or output |
|||
WORD wDigGroupCfg[MAX_DIO_PORT]; // port Group configuration |
|||
} DEVCONFIG_DIO, FAR * LPDEVCONFIG_DIO; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_ADAM Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_ADAM |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usDelay; // delay time before reading response; unit-ms |
|||
USHORT usTimeOut; // time out for reading response; unit-ms |
|||
USHORT usRetry; // retry |
|||
USHORT usAlarmEnabled; // 0-disable, 1-enabled |
|||
USHORT usSlotNo; // slot number |
|||
USHORT usChecksumEnabled; // checksum enabled |
|||
USHORT usDataFormat; // 0-Dec, 2-Hex; for 5080 |
|||
USHORT usCounterMode; // 0-counter mode 0; 1-counter mode 1; 2-freq mode |
|||
CHAR szPreamble[20]; // prefix strings |
|||
CHAR szPostamble[20]; // postfix strings |
|||
} DEVCONFIG_ADAM, FAR * LPDEVCONFIG_ADAM; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_DEVNET Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_DEVNET |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDelayTime; // EPR |
|||
USHORT usAlarmEnabled; // 0-disable, 1-enabled |
|||
DWORD dwMemoryAddress; // beginning address of memory mapped IO to be controlled |
|||
DWORD dwMemoryCount; // number of bytes to be controlled |
|||
USHORT usMyMacID; // host MAC ID |
|||
USHORT usBaudRate; // baud rate |
|||
USHORT usPortNum; // port number |
|||
USHORT usSlotNo; // slot number |
|||
USHORT usMacID; // MAC ID |
|||
USHORT usEventEnabled; // 0-disable, 1-enabled |
|||
CHAR APEventName[15]; // Event name |
|||
HANDLE hEventAP; // Event handle |
|||
WORD wStatus; // status of single slot (device) |
|||
} DEVCONFIG_DEVNET, FAR * LPDEVCONFIG_DEVNET; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_QCOUNTER Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_QCOUNTER |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usDMA; // DMA level |
|||
USHORT usTimerClock; // clock selection |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usCascadeMode; // Cascade Mode ,=0 no cascade, =1 cascade |
|||
USHORT usTimeBase; // Timer Latch setting for time base |
|||
USHORT usTimeDivider; // Timer Latch setting for time divider |
|||
} DEVCONFIG_QCOUNTER, FAR * LPDEVCONFIG_QCOUNTER; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_836 Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_836 |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usCountEdge; // =0 Positive, =1 Negative |
|||
USHORT usFilterEnabled; // 0-disable, 1-enable |
|||
DWORD dwMaxInFreq; // Max input frequency in Hz |
|||
} DEVCONFIG_836, FAR * LPDEVCONFIG_836; |
|||
|
|||
/************************************************************************** |
|||
Direct I/O Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_IO |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
CHAR szDescription[50]; // Description |
|||
} DEVCONFIG_IO, FAR * LPDEVCONFIG_IO; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_175X Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_175X |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usCardNo; // card no of this series |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usInterrupt; // interrupt number |
|||
USHORT usIoPortCount; // number of bytes to be controlled |
|||
USHORT usAllowConflicts; // 1 allow IO conflicts |
|||
USHORT usIntMode; // divide two parts, 0XBB0XAA (8 bits) |
|||
// this bit 7 and 3 fixed to zero |
|||
// the meant of BB port1 mode |
|||
// the meant of AA port0 mode |
|||
// bit 6 is port 1 interrupt trigger edge |
|||
// bit 2 is port 0 interrupt trigger edge |
|||
// (= 1 Rising, = 0 falling) |
|||
USHORT usCascadeMode; // cascade Mode ,=0 no cascade, =1 cascade |
|||
DWORD dwTimer1Count; // timer1 (hi is Counter1, lo is Counter0) |
|||
USHORT dwCounter2Count; // counter 2 count value |
|||
WORD wDigPortCfg[MAX_DIO_PORT]; // port configuration for input or output |
|||
} DEVCONFIG_175X, FAR * LPDEVCONFIG_175X; |
|||
|
|||
typedef struct _AD_WRITE_INPUT { |
|||
ULONG PortNumber; // Port # to write to |
|||
union { // Data to be output to port |
|||
ULONG LongData; |
|||
USHORT ShortData; |
|||
UCHAR CharData; |
|||
}; |
|||
} AD_WRITE_INPUT; |
|||
|
|||
/************************************************************************** |
|||
DEVCONFIG_SIMU Definition |
|||
***************************************************************************/ |
|||
typedef struct tagDEVCONFIG_SIMU |
|||
{ |
|||
DWORD dwBoardID; // board ID code |
|||
USHORT usBaseAddress; // beginning address of ports to be controlled |
|||
USHORT usSimulate; // 1: Simulate IO |
|||
USHORT usDataType; // 0: Float, 1: Long, 2:Byte |
|||
} DEVCONFIG_SIMU, FAR * LPDEVCONFIG_SIMU; |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,197 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: DNET.H |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of DNET.H |
|||
//---------------------------------------------------------------------------- |
|||
#include "..\include\driver.h" |
|||
#ifndef _INC_DNET |
|||
#define _INC_DNET |
|||
|
|||
#ifdef __cplusplus |
|||
//FEXPORT "C" |
|||
extern "C" |
|||
{ |
|||
#endif |
|||
|
|||
#define PORTNUM 11 |
|||
|
|||
#define SUCCESS 0 |
|||
#define DnetInitFailed 1 |
|||
#define DnetSendMsgFailed 2 |
|||
#define DnetRunOutOfMsgID 3 |
|||
#define DnetInvalidInputParam 4 |
|||
#define DnetErrorResponse 5 |
|||
#define DnetNoResponse 6 |
|||
#define DnetBusyOnNetwork 7 |
|||
#define DnetUnknownResponse 8 |
|||
#define DnetNotEnoughBuffer 9 |
|||
#define DnetFragResponseError 10 |
|||
#define DnetTooMuchDataAck 11 |
|||
#define DnetFragRequestError 12 |
|||
#define DnetEnableEventError 13 |
|||
#define DnetCreateOrOpenEventError 14 |
|||
#define DnetIORequestError 15 |
|||
#define DnetGetEventNameError 16 |
|||
#define DnetTimeOutError 17 |
|||
#define DnetOpenFailed 18 |
|||
#define DnetCloseFailed 19 |
|||
#define DnetResetFailed 20 |
|||
#define DnetConfigDataLost 21 |
|||
#define DnetBusOffError 22 |
|||
#define DnetInvalidMsgID 23 |
|||
#define DnetSetEPRFailed 24 |
|||
#define DnetDuplicateMacIDCheckFailed 25 |
|||
#define DnetWaitMsgFailed 26 |
|||
#define DnetGroup2MsgReceive 27 |
|||
#define DnetCheckEventFailed 28 |
|||
#define DnetCheckEventTimeOut 29 |
|||
#define DnetDataOverrunError 30 |
|||
|
|||
#define SC_GET_ATTRIB_ALL 1 |
|||
#define SC_SET_ATTRIB_ALL 2 |
|||
#define SC_RESET 5 |
|||
#define SC_START 6 |
|||
#define SC_STOP 7 |
|||
#define SC_CREATE 8 |
|||
#define SC_DELETE 9 |
|||
#define SC_APPLY_ATTRIB 13 |
|||
#define SC_GET_ATTRIB_SINGLE 14 |
|||
#define SC_SET_ATTRIB_SINGLE 16 |
|||
#define SC_FIND_NEXT_OBJECT_INST 17 |
|||
#define SC_ERROR_RESPONSE 20 |
|||
#define SC_DNRESTORE 21 |
|||
#define SC_SAVE 22 |
|||
#define SC_NO_OPERATION 23 |
|||
#define SC_UCMM_OPEN_REQUEST 75 |
|||
#define SC_UCMM_CLOSE_REQUEST 76 |
|||
|
|||
typedef struct tagCNXINFO |
|||
{ |
|||
WORD Port; // port number 0 or 1 |
|||
unsigned short grp; // message group |
|||
unsigned short id; // destination MAC ID |
|||
unsigned short pid; // producer ID |
|||
unsigned short cid; // consumer ID |
|||
unsigned char format; // message body format |
|||
unsigned short EPR; // expected packet rate |
|||
unsigned short ConnInst; // connection instance ID |
|||
unsigned short size; // data size |
|||
unsigned char data[512]; // data buffer |
|||
} S_CNXINFO; |
|||
|
|||
typedef struct tagS_MSG |
|||
{ |
|||
unsigned char grp; // message group |
|||
unsigned short id; // MAC ID |
|||
unsigned char msg; // message ID |
|||
unsigned char data[512]; // data body (fragment/non-fragment) |
|||
unsigned short len; // data length |
|||
} S_MSG; |
|||
|
|||
typedef struct tagALMSTATUS |
|||
{ |
|||
BOOL LoState; // low alarm state |
|||
BOOL HiState; // high alarm state |
|||
} S_ALMSTATUS; |
|||
|
|||
typedef struct tagEVENTDATA |
|||
{ |
|||
WORD Port; |
|||
WORD MacID; |
|||
CHAR Data[8]; |
|||
int Type; |
|||
} S_EVENTDATA, FAR * LPS_EVENTDATA; |
|||
|
|||
FEXPORT LRESULT FAR PASCAL DNOpen(WORD,WORD FAR *,WORD FAR *,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNClose(WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNInit(WORD,WORD,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNReset(WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNSetTimeout(WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNAllocateGrpMsg(WORD,WORD,WORD,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNFreeGrpMsg(WORD,WORD,WORD,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNUcmmOpenReq(WORD,WORD,WORD,WORD,WORD,WORD, |
|||
S_CNXINFO FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNUcmmCloseReq(S_CNXINFO FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetAttrib(S_CNXINFO FAR *,WORD,WORD,WORD, |
|||
unsigned char FAR *,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAttrib(S_CNXINFO FAR *,WORD,WORD,WORD, |
|||
unsigned char FAR *,WORD,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSendEXPReq(S_CNXINFO FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNGetEXPRsp(S_CNXINFO FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetEventEnabled(int,WORD,WORD,CHAR FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNGetEventData(WORD FAR *,WORD FAR *,int *,CHAR FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAi(S_CNXINFO FAR *,int,float FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetCJC(S_CNXINFO FAR *,int,float FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetChanMask(S_CNXINFO FAR *,int,WORD FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetChanMask(S_CNXINFO FAR *,int,WORD FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAo(S_CNXINFO FAR *,int,float FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetAo(S_CNXINFO FAR *,int,float FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAoStart(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetAoStart(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetDo(S_CNXINFO FAR *,int,WORD FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetDi(S_CNXINFO FAR *,int,WORD FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetDo(S_CNXINFO FAR *,int,WORD FAR *,int,int, |
|||
WORD Type); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAlarmState(S_CNXINFO FAR *,int, |
|||
S_ALMSTATUS FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetHiAlarm(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetLoAlarm(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNSetAlarmEnabled(S_CNXINFO FAR *,int, |
|||
WORD FAR *,WORD FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetHiAlarm(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetLoAlarm(S_CNXINFO FAR *,int,float FAR *,int, |
|||
int); |
|||
FEXPORT LRESULT FAR PASCAL DNGetAlarmEnabled(S_CNXINFO FAR *,int, |
|||
WORD FAR *,WORD FAR *,int,int); |
|||
FEXPORT LRESULT FAR PASCAL DNGet5kVersion(S_CNXINFO FAR *, |
|||
unsigned short FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetEPR(S_CNXINFO FAR *,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGet5kType(S_CNXINFO FAR *,int,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetHz(S_CNXINFO FAR *,int,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGetHz(S_CNXINFO FAR *,int,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetRange(S_CNXINFO FAR *,int,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGetSlew(S_CNXINFO FAR *,int,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSetSlew(S_CNXINFO FAR *,int,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNGetRange(S_CNXINFO FAR *,int,WORD FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNSpanCali(S_CNXINFO FAR *,int); |
|||
FEXPORT LRESULT FAR PASCAL DNZeroCali(S_CNXINFO FAR *,int); |
|||
FEXPORT LRESULT FAR PASCAL DNCJCCali(S_CNXINFO FAR *,int,float); |
|||
FEXPORT LRESULT FAR PASCAL DNAO4mACali(S_CNXINFO FAR *,int,int,float); |
|||
FEXPORT LRESULT FAR PASCAL DNAO20mACali(S_CNXINFO FAR *,int,int,float); |
|||
FEXPORT LRESULT FAR PASCAL DNetResetConnection(WORD, WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNetGetIOReqAndRsp(WORD,S_EVENTDATA far *); |
|||
// Retrieve from Adapi32 & Registry for Devnet API example |
|||
FEXPORT LRESULT FAR PASCAL DNDeviceGetParamOfReg(WORD, USHORT FAR *, |
|||
DWORD FAR *, USHORT FAR *, |
|||
USHORT FAR *,USHORT FAR *, |
|||
USHORT FAR *); |
|||
FEXPORT LRESULT FAR PASCAL DNDeviceGetNumOfList(SHORT far *NumOfDevices); |
|||
FEXPORT LRESULT FAR PASCAL DNDeviceGetList(DEVLIST far *DeviceList, |
|||
SHORT MaxEntries, SHORT far *OutEntries); |
|||
FEXPORT LRESULT FAR PASCAL DNDeviceGetSubList(DWORD DeviceNum, |
|||
DEVLIST far *SubDevList, SHORT MaxEntries, |
|||
SHORT far *OutEntries); |
|||
FEXPORT LRESULT FAR PASCAL DNNodeReset(WORD,WORD); |
|||
FEXPORT LRESULT FAR PASCAL DNEnableEvent(WORD,WORD,BOOL); |
|||
FEXPORT LRESULT FAR PASCAL DNCheckEvent(WORD,DWORD); |
|||
//1999_5_17 |
|||
FEXPORT LRESULT FAR PASCAL DNCheckDuplicatedMacID(WORD,WORD); |
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
#endif |
|||
2042
PC_104/LgLib/Advantech/adsapi/include/driver.h
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,21 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: OS.H |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of OS.H |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef _INC_OS |
|||
#define _INC_OS |
|||
|
|||
//#define _WINNT 1 |
|||
//#define _WIN31 1 |
|||
//#define _WIN95 1 |
|||
|
|||
#endif |
|||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,9 @@ |
|||
SCC = This is a Source Code Control file |
|||
|
|||
[LgLibAdvantech.vcproj] |
|||
SCC_Aux_Path = "\\Lgs\SOURCESAFE\" |
|||
SCC_Project_Name = "$/System/LgLib/Advantech", IVFAAAAA |
|||
|
|||
[LgLibAdvantech.dsp] |
|||
SCC_Aux_Path = "\\Lgs\SOURCESAFE\" |
|||
SCC_Project_Name = "$/System/LgLib/Advantech", IVFAAAAA |
|||
Binary file not shown.
@ -0,0 +1,420 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: CLDm.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CLD_DATA |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __CLD__DATA__H__INCLUDED__ |
|||
#define __CLD__DATA__H__INCLUDED__ |
|||
|
|||
struct CLD_DATA |
|||
{ |
|||
public: |
|||
static INT BuildCmdGetState( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_STATE; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdChangeAddress( PBYTE pBuffer, BYTE bAddress, BYTE bNewAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_CHANGE_ADDRESS; |
|||
*pBuffer++ = bNewAddress; |
|||
return 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetAddress( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
*pBuffer++ = 0; |
|||
*pBuffer++ = CMD_GET_ADDRESS; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
return 10; |
|||
} |
|||
|
|||
static INT BuildCmdSetAddress( PBYTE pBuffer, PBYTE pSerialNumber, BYTE bNewAddress ) |
|||
{ |
|||
*pBuffer++ = 0; |
|||
*pBuffer++ = CMD_SET_ADDRESS; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
*pBuffer++ = bNewAddress; |
|||
return 11; |
|||
} |
|||
|
|||
static INT BuildCmdGetSerialNumber( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_SERIALNUMBER; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetSerialNumber( PBYTE pBuffer, BYTE bAddress, PBYTE pSerialNumber ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_SERIALNUMBER; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
return 10; |
|||
} |
|||
|
|||
static INT BuildCmdGetSoftwareVersion( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_SOFTWAREVERSION; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdReset( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_RESET; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdGetParameters( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_PARAMETERS; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetParameters( PBYTE pBuffer, BYTE bAddress, BYTE nOffset, BYTE nWidth, WORD nFlip ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_PARAMETERS; |
|||
*pBuffer++ = nOffset; |
|||
*pBuffer++ = nWidth; |
|||
*pBuffer++ = nFlip & 0xFF; |
|||
*pBuffer++ = nFlip >> 8; |
|||
return 6; |
|||
} |
|||
|
|||
static INT BuildCmdGetRelayParameters( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_RELAY_PARAMETERS; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetRelayParameters( PBYTE pBuffer, BYTE bAddress, BOOL bEnable, BOOL bInvert ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_RELAY_PARAMETERS; |
|||
*pBuffer++ = ( bEnable ? 0x01 : 0x00 ) | ( bInvert ? 0x02 : 0x00 ); |
|||
return 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetBorder( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_BORDER; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdGetTemperature( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_TEMPERATURE; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdGetTemperatureParameters( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_TEMPERATURE_PARAMETERS; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetTemperatureParameters( PBYTE pBuffer, BYTE bAddress, WORD wTemperature ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_TEMPERATURE_PARAMETERS; |
|||
*pBuffer++ = wTemperature & 0xFF; |
|||
*pBuffer++ = wTemperature >> 8; |
|||
return 4; |
|||
} |
|||
|
|||
enum{ MAX_CALIBRATION_TABLE = 8 }; |
|||
|
|||
typedef struct CALIBRATION_ITEM |
|||
{ |
|||
WORD wDigital; |
|||
WORD wReal; |
|||
}CALIBRATION_ITEM; |
|||
|
|||
static INT BuildCmdSetCalibrationTable( PBYTE pBuffer, BYTE bAddress, CALIBRATION_ITEM *pTable, INT nCount ) |
|||
{ |
|||
INT nCountTmp = nCount; |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_CALIBRATION_TABLE; |
|||
*pBuffer++ = nCount; |
|||
while( nCount-- ) |
|||
{ |
|||
*pBuffer++ = pTable->wDigital & 0xFF; |
|||
*pBuffer++ = pTable->wDigital >> 8; |
|||
*pBuffer++ = pTable->wReal & 0xFF; |
|||
*pBuffer++ = pTable->wReal >> 8; |
|||
pTable++; |
|||
} |
|||
return nCountTmp * 4 + 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetCalibrationTable( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_CALIBRATION_TABLE; |
|||
return 2; |
|||
} |
|||
|
|||
enum{ MAX_HZ_TABLE = 8 }; |
|||
|
|||
typedef struct HZ_ITEM |
|||
{ |
|||
WORD wFrom; |
|||
WORD wTo; |
|||
}HZ_ITEM; |
|||
|
|||
static INT BuildCmdSetHzTable( PBYTE pBuffer, BYTE bAddress, HZ_ITEM *pTable, INT nCount ) |
|||
{ |
|||
INT nCountTmp = nCount; |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_HZ_TABLE; |
|||
*pBuffer++ = nCount; |
|||
while( nCount-- ) |
|||
{ |
|||
*pBuffer++ = pTable->wFrom & 0xFF; |
|||
*pBuffer++ = pTable->wFrom >> 8; |
|||
*pBuffer++ = pTable->wTo & 0xFF; |
|||
*pBuffer++ = pTable->wTo >> 8; |
|||
pTable++; |
|||
} |
|||
return nCountTmp * 4 + 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetHzTable( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_HZ_TABLE; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtGetState( PBYTE pBuffer, PBOOL pAlarm, PWORD pRange, PBOOL pError, PBYTE pErrorID, PBOOL pTest, PWORD pValue ) |
|||
{ |
|||
switch( *pBuffer++ ) |
|||
{ |
|||
case 0: |
|||
*pAlarm = *pError = *pTest = FALSE; |
|||
return 1; |
|||
case 1: |
|||
*pAlarm = TRUE; |
|||
*pRange = *(WORD*)pBuffer; pBuffer += 2; |
|||
*pError = FALSE; |
|||
*pTest = FALSE; |
|||
return 3; |
|||
case 2: |
|||
*pError = TRUE; |
|||
*pErrorID = *pBuffer++; |
|||
*pAlarm = FALSE; |
|||
*pTest = FALSE; |
|||
return 2; |
|||
case 3: |
|||
*pTest = TRUE; |
|||
*pValue = *(WORD*)pBuffer; pBuffer += 2; |
|||
*pAlarm = FALSE; |
|||
*pError = FALSE; |
|||
return 3; |
|||
default: |
|||
*pAlarm = *pError = *pTest = FALSE; |
|||
return 1; |
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
static INT GetEvtChangeAddress( PBYTE pBuffer, PBYTE pNewAddress ) |
|||
{ |
|||
*pNewAddress = *pBuffer++; |
|||
return 1; |
|||
} |
|||
|
|||
static INT GetEvtGetAddress( PBYTE pBuffer, PBYTE pSerialNumber, PBYTE pAddress ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
*pAddress = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtSetAddress( PBYTE pBuffer, PBYTE pSerialNumber, PBYTE pAddress ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
*pAddress = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtGetSerialNumber( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
return 8; |
|||
} |
|||
|
|||
static INT GetEvtSetSerialNumber( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
return 8; |
|||
} |
|||
|
|||
static INT GetEvtGetSoftwareVersion( PBYTE pBuffer, PBYTE pSoftwareVersion ) |
|||
{ |
|||
for( INT i = 0; i < 9; i++ ) |
|||
*pSoftwareVersion++ = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtGetParameters( PBYTE pBuffer, PBYTE pOffset, PBYTE pWidth, PWORD pFlip ) |
|||
{ |
|||
*pOffset = *pBuffer++; |
|||
*pWidth = *pBuffer++; |
|||
*pFlip = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 4; |
|||
} |
|||
|
|||
static INT GetEvtSetParameters( PBYTE pBuffer, PBYTE pOffset, PBYTE pWidth, PWORD pFlip ) |
|||
{ |
|||
*pOffset = *pBuffer++; |
|||
*pWidth = *pBuffer++; |
|||
*pFlip = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 4; |
|||
} |
|||
|
|||
static INT GetEvtGetRelayParameters( PBYTE pBuffer, PBOOL pEnable, PBOOL pInvert ) |
|||
{ |
|||
*pEnable = *pBuffer & 0x01; |
|||
*pInvert = *pBuffer++ & 0x02; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtSetRelayParameters( PBYTE pBuffer, PBOOL pEnable, PBOOL pInvert ) |
|||
{ |
|||
return GetEvtGetRelayParameters( pBuffer, pEnable, pInvert ); |
|||
} |
|||
|
|||
static INT GetEvtGetBorder( PBYTE pBuffer, PWORD pMin, PWORD pMax ) |
|||
{ |
|||
*pMin = *(PWORD)pBuffer; pBuffer += 2; |
|||
*pMax = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 4; |
|||
} |
|||
|
|||
static INT GetEvtGetTemperature( PBYTE pBuffer, PWORD pTemperature ) |
|||
{ |
|||
*pTemperature = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtSetTemperatureParameters( PBYTE pBuffer, PWORD pTemperature ) |
|||
{ |
|||
*pTemperature = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtGetTemperatureParameters( PBYTE pBuffer, PWORD pTemperature ) |
|||
{ |
|||
*pTemperature = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtGetCalibrationTable( PBYTE pBuffer, CALIBRATION_ITEM *pTable, PINT pCount ) |
|||
{ |
|||
*pCount = *pBuffer++; |
|||
INT nCountTmp = *pCount; |
|||
while( nCountTmp-- ) |
|||
{ |
|||
pTable->wDigital = *pBuffer++; |
|||
pTable->wDigital |= ((WORD)*pBuffer++) << 8; |
|||
pTable->wReal = *pBuffer++; |
|||
pTable->wReal |= ((WORD)*pBuffer++) << 8; |
|||
pTable++; |
|||
} |
|||
return *pCount * 4 + 1; |
|||
} |
|||
|
|||
static INT GetEvtGetHzTable( PBYTE pBuffer, HZ_ITEM *pTable, PINT pCount ) |
|||
{ |
|||
*pCount = *pBuffer++; |
|||
INT nCountTmp = *pCount; |
|||
while( nCountTmp-- ) |
|||
{ |
|||
pTable->wFrom = *pBuffer++; |
|||
pTable->wFrom |= ((WORD)*pBuffer++) << 8; |
|||
pTable->wTo = *pBuffer++; |
|||
pTable->wTo |= ((WORD)*pBuffer++) << 8; |
|||
pTable++; |
|||
} |
|||
return *pCount * 4 + 1; |
|||
} |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
CMD_GET_STATE = 0, |
|||
CMD_CHANGE_ADDRESS = 1, |
|||
CMD_GET_ADDRESS = 2, |
|||
CMD_SET_ADDRESS = 3, |
|||
CMD_GET_SERIALNUMBER = 4, |
|||
CMD_SET_SERIALNUMBER = 5, |
|||
CMD_GET_SOFTWAREVERSION = 6, |
|||
CMD_RESET = 7, |
|||
CMD_GET_PARAMETERS = 8, |
|||
CMD_SET_PARAMETERS = 9, |
|||
CMD_GET_BORDER = 10, |
|||
CMD_GET_RELAY_PARAMETERS = 11, |
|||
CMD_SET_RELAY_PARAMETERS = 12, |
|||
CMD_GET_TEMPERATURE = 13, |
|||
CMD_GET_TEMPERATURE_PARAMETERS = 14, |
|||
CMD_SET_TEMPERATURE_PARAMETERS = 15, |
|||
CMD_GET_CALIBRATION_TABLE = 16, |
|||
CMD_SET_CALIBRATION_TABLE = 17, |
|||
CMD_GET_HZ_TABLE = 18, |
|||
CMD_SET_HZ_TABLE = 19, |
|||
}; |
|||
|
|||
enum |
|||
{ |
|||
CLD_ERROR_TEST = 0, |
|||
}; |
|||
|
|||
enum |
|||
{ |
|||
EXCLUSIVE_ADDRESS = 0 |
|||
}; |
|||
|
|||
public: |
|||
static double RangeToValue( WORD wRange ) |
|||
{ |
|||
return ((double)wRange) / (double)0x3FF; |
|||
} |
|||
static double TemperatureToValue( WORD wTemperature ) |
|||
{ |
|||
return (double)(short)wTemperature / 10.; |
|||
} |
|||
static WORD ValueToTemperature( double dTemperature ) |
|||
{ |
|||
return (WORD)(short)(dTemperature * 10.); |
|||
} |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,420 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: CLDm.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CRF_DATA |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __CLD__DATA__H__INCLUDED__ |
|||
#define __CLD__DATA__H__INCLUDED__ |
|||
|
|||
struct CLD_DATA |
|||
{ |
|||
public: |
|||
static INT BuildCmdGetState( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_STATE; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdChangeAddress( PBYTE pBuffer, BYTE bAddress, BYTE bNewAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_CHANGE_ADDRESS; |
|||
*pBuffer++ = bNewAddress; |
|||
return 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetAddress( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
*pBuffer++ = 0; |
|||
*pBuffer++ = CMD_GET_ADDRESS; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
return 10; |
|||
} |
|||
|
|||
static INT BuildCmdSetAddress( PBYTE pBuffer, PBYTE pSerialNumber, BYTE bNewAddress ) |
|||
{ |
|||
*pBuffer++ = 0; |
|||
*pBuffer++ = CMD_SET_ADDRESS; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
*pBuffer++ = bNewAddress; |
|||
return 11; |
|||
} |
|||
|
|||
static INT BuildCmdGetSerialNumber( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_SERIALNUMBER; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetSerialNumber( PBYTE pBuffer, BYTE bAddress, PBYTE pSerialNumber ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_SERIALNUMBER; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
return 10; |
|||
} |
|||
|
|||
static INT BuildCmdGetSoftwareVersion( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_SOFTWAREVERSION; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdReset( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_RESET; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdGetParameters( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_PARAMETERS; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetParameters( PBYTE pBuffer, BYTE bAddress, BYTE nOffset, BYTE nWidth, WORD nFlip ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_PARAMETERS; |
|||
*pBuffer++ = nOffset; |
|||
*pBuffer++ = nWidth; |
|||
*pBuffer++ = nFlip & 0xFF; |
|||
*pBuffer++ = nFlip >> 8; |
|||
return 6; |
|||
} |
|||
|
|||
static INT BuildCmdGetRelayParameters( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_RELAY_PARAMETERS; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetRelayParameters( PBYTE pBuffer, BYTE bAddress, BOOL bEnable, BOOL bInvert ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_RELAY_PARAMETERS; |
|||
*pBuffer++ = ( bEnable ? 0x01 : 0x00 ) | ( bInvert ? 0x02 : 0x00 ); |
|||
return 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetBorder( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_BORDER; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdGetTemperature( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_TEMPERATURE; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdGetTemperatureParameters( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_TEMPERATURE_PARAMETERS; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetTemperatureParameters( PBYTE pBuffer, BYTE bAddress, WORD wTemperature ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_TEMPERATURE_PARAMETERS; |
|||
*pBuffer++ = wTemperature & 0xFF; |
|||
*pBuffer++ = wTemperature >> 8; |
|||
return 4; |
|||
} |
|||
|
|||
enum{ MAX_CALIBRATION_TABLE = 8 }; |
|||
|
|||
typedef struct CALIBRATION_ITEM |
|||
{ |
|||
WORD wDigital; |
|||
WORD wReal; |
|||
}CALIBRATION_ITEM; |
|||
|
|||
static INT BuildCmdSetCalibrationTable( PBYTE pBuffer, BYTE bAddress, CALIBRATION_ITEM *pTable, INT nCount ) |
|||
{ |
|||
INT nCountTmp = nCount; |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_CALIBRATION_TABLE; |
|||
*pBuffer++ = nCount; |
|||
while( nCount-- ) |
|||
{ |
|||
*pBuffer++ = pTable->wDigital & 0xFF; |
|||
*pBuffer++ = pTable->wDigital >> 8; |
|||
*pBuffer++ = pTable->wReal & 0xFF; |
|||
*pBuffer++ = pTable->wReal >> 8; |
|||
pTable++; |
|||
} |
|||
return nCountTmp * 4 + 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetCalibrationTable( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_CALIBRATION_TABLE; |
|||
return 2; |
|||
} |
|||
|
|||
enum{ MAX_HZ_TABLE = 8 }; |
|||
|
|||
typedef struct HZ_ITEM |
|||
{ |
|||
WORD wFrom; |
|||
WORD wTo; |
|||
}HZ_ITEM; |
|||
|
|||
static INT BuildCmdSetHzTable( PBYTE pBuffer, BYTE bAddress, HZ_ITEM *pTable, INT nCount ) |
|||
{ |
|||
INT nCountTmp = nCount; |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_HZ_TABLE; |
|||
*pBuffer++ = nCount; |
|||
while( nCount-- ) |
|||
{ |
|||
*pBuffer++ = pTable->wFrom & 0xFF; |
|||
*pBuffer++ = pTable->wFrom >> 8; |
|||
*pBuffer++ = pTable->wTo & 0xFF; |
|||
*pBuffer++ = pTable->wTo >> 8; |
|||
pTable++; |
|||
} |
|||
return nCountTmp * 4 + 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetHzTable( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_HZ_TABLE; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtGetState( PBYTE pBuffer, PBOOL pAlarm, PWORD pRange, PBOOL pError, PBYTE pErrorID, PBOOL pTest, PWORD pValue ) |
|||
{ |
|||
switch( *pBuffer++ ) |
|||
{ |
|||
case 0: |
|||
*pAlarm = *pError = *pTest = FALSE; |
|||
return 1; |
|||
case 1: |
|||
*pAlarm = TRUE; |
|||
*pRange = *(WORD*)pBuffer; pBuffer += 2; |
|||
*pError = FALSE; |
|||
*pTest = FALSE; |
|||
return 3; |
|||
case 2: |
|||
*pError = TRUE; |
|||
*pErrorID = *pBuffer++; |
|||
*pAlarm = FALSE; |
|||
*pTest = FALSE; |
|||
return 2; |
|||
case 3: |
|||
*pTest = TRUE; |
|||
*pValue = *(WORD*)pBuffer; pBuffer += 2; |
|||
*pAlarm = FALSE; |
|||
*pError = FALSE; |
|||
return 3; |
|||
default: |
|||
*pAlarm = *pError = *pTest = FALSE; |
|||
return 1; |
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
static INT GetEvtChangeAddress( PBYTE pBuffer, PBYTE pNewAddress ) |
|||
{ |
|||
*pNewAddress = *pBuffer++; |
|||
return 1; |
|||
} |
|||
|
|||
static INT GetEvtGetAddress( PBYTE pBuffer, PBYTE pSerialNumber, PBYTE pAddress ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
*pAddress = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtSetAddress( PBYTE pBuffer, PBYTE pSerialNumber, PBYTE pAddress ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
*pAddress = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtGetSerialNumber( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
return 8; |
|||
} |
|||
|
|||
static INT GetEvtSetSerialNumber( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
return 8; |
|||
} |
|||
|
|||
static INT GetEvtGetSoftwareVersion( PBYTE pBuffer, PBYTE pSoftwareVersion ) |
|||
{ |
|||
for( INT i = 0; i < 9; i++ ) |
|||
*pSoftwareVersion++ = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtGetParameters( PBYTE pBuffer, PBYTE pOffset, PBYTE pWidth, PWORD pFlip ) |
|||
{ |
|||
*pOffset = *pBuffer++; |
|||
*pWidth = *pBuffer++; |
|||
*pFlip = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 4; |
|||
} |
|||
|
|||
static INT GetEvtSetParameters( PBYTE pBuffer, PBYTE pOffset, PBYTE pWidth, PWORD pFlip ) |
|||
{ |
|||
*pOffset = *pBuffer++; |
|||
*pWidth = *pBuffer++; |
|||
*pFlip = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 4; |
|||
} |
|||
|
|||
static INT GetEvtGetRelayParameters( PBYTE pBuffer, PBOOL pEnable, PBOOL pInvert ) |
|||
{ |
|||
*pEnable = *pBuffer & 0x01; |
|||
*pInvert = *pBuffer++ & 0x02; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtSetRelayParameters( PBYTE pBuffer, PBOOL pEnable, PBOOL pInvert ) |
|||
{ |
|||
return GetEvtGetRelayParameters( pBuffer, pEnable, pInvert ); |
|||
} |
|||
|
|||
static INT GetEvtGetBorder( PBYTE pBuffer, PWORD pMin, PWORD pMax ) |
|||
{ |
|||
*pMin = *(PWORD)pBuffer; pBuffer += 2; |
|||
*pMax = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 4; |
|||
} |
|||
|
|||
static INT GetEvtGetTemperature( PBYTE pBuffer, PWORD pTemperature ) |
|||
{ |
|||
*pTemperature = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtSetTemperatureParameters( PBYTE pBuffer, PWORD pTemperature ) |
|||
{ |
|||
*pTemperature = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtGetTemperatureParameters( PBYTE pBuffer, PWORD pTemperature ) |
|||
{ |
|||
*pTemperature = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtGetCalibrationTable( PBYTE pBuffer, CALIBRATION_ITEM *pTable, PINT pCount ) |
|||
{ |
|||
*pCount = *pBuffer++; |
|||
INT nCountTmp = *pCount; |
|||
while( nCountTmp-- ) |
|||
{ |
|||
pTable->wDigital = *pBuffer++; |
|||
pTable->wDigital |= ((WORD)*pBuffer++) << 8; |
|||
pTable->wReal = *pBuffer++; |
|||
pTable->wReal |= ((WORD)*pBuffer++) << 8; |
|||
pTable++; |
|||
} |
|||
return *pCount * 4 + 1; |
|||
} |
|||
|
|||
static INT GetEvtGetHzTable( PBYTE pBuffer, HZ_ITEM *pTable, PINT pCount ) |
|||
{ |
|||
*pCount = *pBuffer++; |
|||
INT nCountTmp = *pCount; |
|||
while( nCountTmp-- ) |
|||
{ |
|||
pTable->wFrom = *pBuffer++; |
|||
pTable->wFrom |= ((WORD)*pBuffer++) << 8; |
|||
pTable->wTo = *pBuffer++; |
|||
pTable->wTo |= ((WORD)*pBuffer++) << 8; |
|||
pTable++; |
|||
} |
|||
return *pCount * 4 + 1; |
|||
} |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
CMD_GET_STATE = 0, |
|||
CMD_CHANGE_ADDRESS = 1, |
|||
CMD_GET_ADDRESS = 2, |
|||
CMD_SET_ADDRESS = 3, |
|||
CMD_GET_SERIALNUMBER = 4, |
|||
CMD_SET_SERIALNUMBER = 5, |
|||
CMD_GET_SOFTWAREVERSION = 6, |
|||
CMD_RESET = 7, |
|||
CMD_GET_PARAMETERS = 8, |
|||
CMD_SET_PARAMETERS = 9, |
|||
CMD_GET_BORDER = 10, |
|||
CMD_GET_RELAY_PARAMETERS = 11, |
|||
CMD_SET_RELAY_PARAMETERS = 12, |
|||
CMD_GET_TEMPERATURE = 13, |
|||
CMD_GET_TEMPERATURE_PARAMETERS = 14, |
|||
CMD_SET_TEMPERATURE_PARAMETERS = 15, |
|||
CMD_GET_CALIBRATION_TABLE = 16, |
|||
CMD_SET_CALIBRATION_TABLE = 17, |
|||
CMD_GET_HZ_TABLE = 18, |
|||
CMD_SET_HZ_TABLE = 19, |
|||
}; |
|||
|
|||
enum |
|||
{ |
|||
CLD_ERROR_TEST = 0, |
|||
}; |
|||
|
|||
enum |
|||
{ |
|||
EXCLUSIVE_ADDRESS = 0 |
|||
}; |
|||
|
|||
public: |
|||
static double RangeToValue( WORD wRange ) |
|||
{ |
|||
return ((double)wRange) / (double)0x3FF; |
|||
} |
|||
static double TemperatureToValue( WORD wTemperature ) |
|||
{ |
|||
return (double)(short)wTemperature / 10.; |
|||
} |
|||
static WORD ValueToTemperature( double dTemperature ) |
|||
{ |
|||
return (WORD)(short)(dTemperature * 10.); |
|||
} |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,32 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: Connect.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CConnection |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __CONNECTION__H__INCLUDED__ |
|||
#define __CONNECTION__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif |
|||
|
|||
class CConnection { |
|||
public: |
|||
virtual DWORD Read( PBYTE pBuffer, DWORD dwSize, DWORD dwTimeout ) = 0; |
|||
virtual DWORD Write( PBYTE pBuffer, DWORD dwSize, DWORD dwTimeout ) = 0; |
|||
|
|||
public: |
|||
virtual BOOL SetRTS( BOOL bOn ) = 0; |
|||
virtual BOOL SetDTR( BOOL bOn ) = 0; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,450 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZFlir.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZFlir.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__FLIR__D__H__INCLUDED__ |
|||
#define __PTZ__FLIR__D__H__INCLUDED__ |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZFlir : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZFlir(); |
|||
virtual ~CProtocolPTZFlir(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_FLIR |
|||
{ |
|||
typedef enum E_MOVE_DIR |
|||
{ |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE |
|||
{ |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
|
|||
static INT CheckSum( LPBYTE pBuffer ) |
|||
{ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
|
|||
static INT BuildSetPan( LPBYTE pBuffer, BYTE bAddress, WORD wPan ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4B; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetTilt( LPBYTE pBuffer, BYTE bAddress, WORD wTilt ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4D; // data byte 4 |
|||
pBuffer[ 4] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4F; // data byte 4 |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetPan( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x51; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetTilt( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x53; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x55; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
|
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ) |
|||
{ |
|||
//BYTE bCommand1 = 0x88; |
|||
BYTE bCommand1 = 0x00; |
|||
BYTE bCommand2 = 0; |
|||
switch( PtzState.ePanDir & PAN_MASK ) |
|||
{ |
|||
case PAN_LEFT: bCommand2 |= 0x04; break; |
|||
case PAN_RIGHT: bCommand2 |= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ) |
|||
{ |
|||
case TILT_UP: bCommand2 |= 0x08; break; |
|||
case TILT_DOWN: bCommand2 |= 0x10; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
|
|||
switch( PtzState.eIrisDir & IRIS_MASK ) |
|||
{ |
|||
case IRIS_OPEN: bCommand1 |= 0x02; break; |
|||
case IRIS_CLOSE: bCommand1 |= 0x04; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ) |
|||
{ |
|||
case FOCUS_FAR: bCommand2 |= 0x80; break; |
|||
case FOCUS_NEAR: bCommand1 |= 0x01; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ) |
|||
{ |
|||
case ZOOM_TELE: bCommand2 |= 0x20; break; |
|||
case ZOOM_WIDE: bCommand2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
|
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = bCommand1; // data byte 3 |
|||
pBuffer[ 3] = bCommand2; // data byte 4 |
|||
|
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2B; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoIris( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2D; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoGainControl( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2F; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildBacklightCompensation( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x31; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildWhiteBalance( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x33; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ) |
|||
{ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return 360 - wPan * 360L / 35999L; |
|||
} else { |
|||
return wPan * 360L / 35999L; |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ) |
|||
{ |
|||
// PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return (WORD)( (360 - Angle) * 35999L / 360L ); |
|||
} else { |
|||
return (WORD)( Angle * 35999L / 360L ); |
|||
} |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
return wTilt * 360L / 35999L; |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (WORD)( dAngle * 35999L / 360L ); |
|||
} |
|||
|
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
/* enum |
|||
{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
};*/ |
|||
|
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , int MaxZoom ) |
|||
{ |
|||
int ZMIN = 0; |
|||
int ZMAX = MaxZoom; |
|||
int ZLIM = ZMAX - ZMIN; |
|||
WORD PERC = ZLIM / 100; |
|||
WORD AA = (dPercent * PERC) & 0xFFFF; |
|||
return AA; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, int MaxZoom ) |
|||
{ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = 0; |
|||
float ZMAX = MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
int AA = (int)((((float)(wZoom) - ZLIM ) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0x11L; |
|||
} |
|||
|
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0xFEL; |
|||
} |
|||
|
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
if ( dPercent<30 && dPercent > 0 ) dPercent = 30; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x3F / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 0x3F; |
|||
} |
|||
|
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
|
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
|
|||
}PTZ_FLIR; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,471 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: CLDm.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZ_HEBRON |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __PTZ_HEBRON__H__INCLUDED__ |
|||
#define __PTZ_HEBRON__H__INCLUDED__ |
|||
|
|||
struct PTZ_HEBRON |
|||
{ |
|||
public: |
|||
static INT BuildCmdChangeAddress( PBYTE pBuffer, BYTE bAddress, BYTE bNewAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_CHANGE_ADDRESS; |
|||
*pBuffer++ = bNewAddress; |
|||
return 3; |
|||
} |
|||
|
|||
static INT BuildCmdGetAddress( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
*pBuffer++ = 0; |
|||
*pBuffer++ = CMD_GET_ADDRESS; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
return 10; |
|||
} |
|||
|
|||
static INT BuildCmdSetAddress( PBYTE pBuffer, PBYTE pSerialNumber, BYTE bNewAddress ) |
|||
{ |
|||
*pBuffer++ = 0; |
|||
*pBuffer++ = CMD_SET_ADDRESS; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
*pBuffer++ = bNewAddress; |
|||
return 11; |
|||
} |
|||
|
|||
static INT BuildCmdGetSerialNumber( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_SERIALNUMBER; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetSerialNumber( PBYTE pBuffer, BYTE bAddress, PBYTE pSerialNumber ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_SERIALNUMBER; |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pBuffer++ = *pSerialNumber++; |
|||
return 10; |
|||
} |
|||
|
|||
static INT BuildCmdGetSoftwareVersion( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_SOFTWAREVERSION; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdGetParameters( PBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_PARAMETERS; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildCmdSetParameters( PBYTE pBuffer, BYTE bAddress, BYTE nOffset, BYTE nWidth, WORD nFlip ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_PARAMETERS; |
|||
*pBuffer++ = nOffset; |
|||
*pBuffer++ = nWidth; |
|||
*pBuffer++ = nFlip & 0xFF; |
|||
*pBuffer++ = nFlip >> 8; |
|||
return 6; |
|||
} |
|||
|
|||
static INT BuildSetPosition( PBYTE& pBuffer, BYTE bAddress, WORD wPan, WORD wTilt, WORD wZoom ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_POSITION; |
|||
*pBuffer++ = wPan & 0xFF; |
|||
*pBuffer++ = wPan >> 8; |
|||
*pBuffer++ = wTilt & 0xFF; |
|||
*pBuffer++ = wTilt >> 8; |
|||
*pBuffer++ = wZoom & 0xFF; |
|||
*pBuffer++ = wZoom >> 8; |
|||
return 8; |
|||
} |
|||
|
|||
static INT BuildGetPosition( PBYTE& pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_POSITION; |
|||
return 2; |
|||
} |
|||
|
|||
typedef enum MOVE_FLAG |
|||
{ |
|||
MOVE_USE_PAN = 0x01, |
|||
MOVE_USE_TILT = 0x02, |
|||
MOVE_USE_ZOOM = 0x04, |
|||
|
|||
MOVE_PAN_RIGHT = 0x10, |
|||
MOVE_TILT_UP = 0x20, |
|||
MOVE_ZOOM_TELE = 0x40, |
|||
}MOVE_FLAG; |
|||
|
|||
static INT BuildMove( PBYTE& pBuffer, BYTE bAddress, BYTE bFlags, BYTE bPanSpeed, BYTE bTiltSpeed, BYTE bZoomSpeed ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_MOVE; |
|||
*pBuffer++ = bFlags; |
|||
*pBuffer++ = bPanSpeed; |
|||
*pBuffer++ = bTiltSpeed; |
|||
*pBuffer++ = bZoomSpeed; |
|||
return 6; |
|||
} |
|||
|
|||
static INT BuildSetDopler( PBYTE& pBuffer, BYTE bAddress, BOOL bEnable, WORD wStepPan, DWORD dwTimeout ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_DOPLER; |
|||
*pBuffer++ = bEnable; |
|||
*pBuffer++ = (BYTE)((wStepPan >> 0) & 0xFF); |
|||
*pBuffer++ = (BYTE)((wStepPan >> 8) & 0xFF); |
|||
*pBuffer++ = (BYTE)((dwTimeout >> 0) & 0xFF); |
|||
*pBuffer++ = (BYTE)((dwTimeout >> 8) & 0xFF); |
|||
*pBuffer++ = (BYTE)((dwTimeout >> 16) & 0xFF); |
|||
*pBuffer++ = (BYTE)((dwTimeout >> 24) & 0xFF); |
|||
return 9; |
|||
} |
|||
|
|||
static INT BuildGetDopler( PBYTE& pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_DOPLER; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildGetDoplerAlarm( PBYTE& pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_DOPLER_ALARM; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildGetDoplerMask( PBYTE& pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_DOPLER_MASK; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildGetDoplerMaskValue( PBYTE& pBuffer, BYTE bAddress, BYTE nIndex ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_GET_DOPLER_MASK_VALUE; |
|||
*pBuffer++ = nIndex; |
|||
return 3; |
|||
} |
|||
|
|||
static INT BuildSetDoplerMask( PBYTE& pBuffer, BYTE bAddress, BOOL bEnable, BYTE nCount ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_DOPLER_MASK; |
|||
*pBuffer++ = bEnable; |
|||
*pBuffer++ = nCount; |
|||
return 4; |
|||
} |
|||
|
|||
static INT BuildSetDoplerMaskValue( PBYTE& pBuffer, BYTE bAddress, BYTE nIndex, WORD wStart, WORD wStop ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_DOPLER_MASK_VALUE; |
|||
*pBuffer++ = nIndex; |
|||
*pBuffer++ = (wStart >> 0) & 0xFF; |
|||
*pBuffer++ = (wStart >> 8) & 0xFF; |
|||
*pBuffer++ = (wStop >> 0) & 0xFF; |
|||
*pBuffer++ = (wStop >> 8) & 0xFF; |
|||
return 7; |
|||
} |
|||
|
|||
static INT BuildSetDoplerMaskSave( PBYTE& pBuffer, BYTE bAddress ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_DOPLER_MASK_SAVE; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildSetIris( PBYTE& pBuffer, BYTE bAddress, BYTE bIris ) |
|||
{ |
|||
*pBuffer++ = bAddress; |
|||
*pBuffer++ = CMD_SET_IRIS; |
|||
*pBuffer++ = bIris; |
|||
return 3; |
|||
} |
|||
|
|||
//////////////////////////////////////////////////////////////////////////// |
|||
|
|||
static INT GetEvtChangeAddress( PBYTE pBuffer, PBYTE pNewAddress ) |
|||
{ |
|||
*pNewAddress = *pBuffer++; |
|||
return 1; |
|||
} |
|||
|
|||
static INT GetEvtGetAddress( PBYTE pBuffer, PBYTE pSerialNumber, PBYTE pAddress ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
*pAddress = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtSetAddress( PBYTE pBuffer, PBYTE pSerialNumber, PBYTE pAddress ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
*pAddress = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtGetSerialNumber( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
return 8; |
|||
} |
|||
|
|||
static INT GetEvtSetSerialNumber( PBYTE pBuffer, PBYTE pSerialNumber ) |
|||
{ |
|||
for( INT i = 0; i < 8; i++ ) |
|||
*pSerialNumber++ = *pBuffer++; |
|||
return 8; |
|||
} |
|||
|
|||
static INT GetEvtGetSoftwareVersion( PBYTE pBuffer, PBYTE pSoftwareVersion ) |
|||
{ |
|||
for( INT i = 0; i < 9; i++ ) |
|||
*pSoftwareVersion++ = *pBuffer++; |
|||
return 9; |
|||
} |
|||
|
|||
static INT GetEvtGetParameters( PBYTE pBuffer, PBYTE pOffset, PBYTE pWidth, PWORD pFlip ) |
|||
{ |
|||
*pOffset = *pBuffer++; |
|||
*pWidth = *pBuffer++; |
|||
*pFlip = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 4; |
|||
} |
|||
|
|||
static INT GetEvtSetParameters( PBYTE pBuffer, PBYTE pOffset, PBYTE pWidth, PWORD pFlip ) |
|||
{ |
|||
*pOffset = *pBuffer++; |
|||
*pWidth = *pBuffer++; |
|||
*pFlip = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 4; |
|||
} |
|||
|
|||
static INT GetEvtDopler( PBYTE pBuffer, PBOOL pEnable, PWORD pPanStep, PDWORD pTimeout ) |
|||
{ |
|||
*pEnable = *pBuffer++; |
|||
*pPanStep = *(PWORD)pBuffer; pBuffer += 2; |
|||
*pTimeout = *(PDWORD)pBuffer; pBuffer += 4; |
|||
return 7; |
|||
} |
|||
|
|||
static INT GetEvtDoplerMask( PBYTE pBuffer, PBOOL pEnable, PBYTE pCount ) |
|||
{ |
|||
*pEnable = *pBuffer++; |
|||
*pCount = *pBuffer++; |
|||
return 2; |
|||
} |
|||
|
|||
static INT GetEvtDoplerMaskValue( PBYTE pBuffer, PBYTE pIndex, PWORD pStart, PWORD pStop ) |
|||
{ |
|||
*pIndex = *pBuffer++; |
|||
*pStart = *(PWORD)pBuffer; pBuffer += 2; |
|||
*pStop = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 5; |
|||
} |
|||
|
|||
static INT GetEvtDoplerAlarm( PBYTE pBuffer, PBOOL pAlarm, PWORD pPan ) |
|||
{ |
|||
*pAlarm = *pBuffer++; |
|||
*pPan = *(PWORD)pBuffer; pBuffer += 2; |
|||
return 3; |
|||
} |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
CMD_CHANGE_ADDRESS = 0, |
|||
CMD_GET_ADDRESS = 1, |
|||
CMD_SET_ADDRESS = 2, |
|||
CMD_GET_SERIALNUMBER = 3, |
|||
CMD_SET_SERIALNUMBER = 4, |
|||
CMD_GET_SOFTWAREVERSION = 5, |
|||
CMD_GET_PARAMETERS = 6, |
|||
CMD_SET_PARAMETERS = 7, |
|||
|
|||
CMD_GET_POSITION = 10, |
|||
CMD_SET_POSITION = 11, |
|||
|
|||
CMD_MOVE = 12, |
|||
|
|||
CMD_SET_DOPLER = 13, |
|||
CMD_GET_DOPLER = 14, |
|||
CMD_GET_DOPLER_ALARM = 15, |
|||
CMD_SET_DOPLER_MASK = 16, |
|||
CMD_GET_DOPLER_MASK = 17, |
|||
CMD_SET_DOPLER_MASK_VALUE = 18, |
|||
CMD_GET_DOPLER_MASK_VALUE = 19, |
|||
CMD_SET_DOPLER_MASK_SAVE = 20, |
|||
|
|||
CMD_SET_IRIS = 21, |
|||
}; |
|||
|
|||
enum |
|||
{ |
|||
EXCLUSIVE_ADDRESS = 0 |
|||
}; |
|||
|
|||
public: |
|||
static double RangeToValue( WORD wRange ) |
|||
{ |
|||
return ((double)wRange) / (double)0x3FF; |
|||
} |
|||
static double TemperatureToValue( WORD wTemperature ) |
|||
{ |
|||
return (double)(short)wTemperature / 10.; |
|||
} |
|||
static WORD ValueToTemperature( double dTemperature ) |
|||
{ |
|||
return (WORD)(short)(dTemperature * 10.); |
|||
} |
|||
|
|||
public: |
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
return TRUE; |
|||
} |
|||
|
|||
public: |
|||
#define HEVRON_PAN_VALUE_MAX 0x10000L |
|||
#define HEVRON_TILT_VALUE_MAX 0x10000L |
|||
#define HEVRON_ZOOM_VALUE_MAX 0x10000L |
|||
|
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD dwPan ) |
|||
{ |
|||
return 360L - dwPan * 360L / HEVRON_PAN_VALUE_MAX; |
|||
// return dwPan * 360L / HEVRON_PAN_VALUE_MAX; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle ) |
|||
{ |
|||
return (WORD)( (360L - Angle) * (HEVRON_PAN_VALUE_MAX-1) / 360L ); |
|||
// return (WORD)( Angle * (HEVRON_PAN_VALUE_MAX-1) / 360L ); |
|||
} |
|||
|
|||
static CLgDevicePTZ::PTZ_DEGREE DeltaPan2Degree( WORD dwPan ) |
|||
{ |
|||
return dwPan * 360L / HEVRON_PAN_VALUE_MAX; |
|||
} |
|||
static WORD DeltaDegree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle ) |
|||
{ |
|||
return (WORD)( Angle * (HEVRON_PAN_VALUE_MAX-1) / 360L ); |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
return wTilt * 360L / HEVRON_TILT_VALUE_MAX; |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (WORD)( dAngle * (HEVRON_TILT_VALUE_MAX-1) / 360L ); |
|||
} |
|||
|
|||
// zoom |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom ) |
|||
{ |
|||
return wZoom * 100L / HEVRON_ZOOM_VALUE_MAX; |
|||
} |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (WORD)( dPercent * (HEVRON_ZOOM_VALUE_MAX-1) / 100L ); |
|||
} |
|||
|
|||
public: |
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 255L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 255L; |
|||
} |
|||
|
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 255L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 255L; |
|||
} |
|||
|
|||
// zoom speed |
|||
static BYTE Percent2ZoomSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 255L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT ZoomSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 255L; |
|||
} |
|||
|
|||
public: |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b2) << 8) | ((WORD)b1); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b2) << 8) | ((WORD)b1); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b2) << 8) | ((WORD)b1); |
|||
} |
|||
|
|||
public: |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT percent ) |
|||
{ |
|||
if( percent > 100 ) percent = 100; |
|||
if( percent < 0 ) percent = 0; |
|||
return (BYTE)( percent * 255L / 100L ); |
|||
} |
|||
|
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE percent ) |
|||
{ |
|||
return (BYTE)( percent * 100L / 255L ); |
|||
} |
|||
|
|||
}; |
|||
|
|||
#endif |
|||
2379
PC_104/LgLib/Comm/LGSM.H.bak
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,250 @@ |
|||
# Microsoft Developer Studio Project File - Name="LgLibComm" - Package Owner=<4> |
|||
# Microsoft Developer Studio Generated Build File, Format Version 6.00 |
|||
# ** DO NOT EDIT ** |
|||
|
|||
# TARGTYPE "Win32 (x86) Static Library" 0x0104 |
|||
|
|||
CFG=LgLibComm - Win32 Debug |
|||
!MESSAGE This is not a valid makefile. To build this project using NMAKE, |
|||
!MESSAGE use the Export Makefile command and run |
|||
!MESSAGE |
|||
!MESSAGE NMAKE /f "LgLibComm.mak". |
|||
!MESSAGE |
|||
!MESSAGE You can specify a configuration when running NMAKE |
|||
!MESSAGE by defining the macro CFG on the command line. For example: |
|||
!MESSAGE |
|||
!MESSAGE NMAKE /f "LgLibComm.mak" CFG="LgLibComm - Win32 Debug" |
|||
!MESSAGE |
|||
!MESSAGE Possible choices for configuration are: |
|||
!MESSAGE |
|||
!MESSAGE "LgLibComm - Win32 Release" (based on "Win32 (x86) Static Library") |
|||
!MESSAGE "LgLibComm - Win32 Debug" (based on "Win32 (x86) Static Library") |
|||
!MESSAGE |
|||
|
|||
# Begin Project |
|||
# PROP AllowPerConfigDependencies 0 |
|||
# PROP Scc_ProjName ""$/System/System", TRFAAAAA" |
|||
# PROP Scc_LocalPath "..\..\system" |
|||
CPP=cl.exe |
|||
RSC=rc.exe |
|||
|
|||
!IF "$(CFG)" == "LgLibComm - Win32 Release" |
|||
|
|||
# PROP BASE Use_MFC 0 |
|||
# PROP BASE Use_Debug_Libraries 0 |
|||
# PROP BASE Output_Dir "Release" |
|||
# PROP BASE Intermediate_Dir "Release" |
|||
# PROP BASE Target_Dir "" |
|||
# PROP Use_MFC 0 |
|||
# PROP Use_Debug_Libraries 0 |
|||
# PROP Output_Dir "..\..\Intermediate\6\Release\LgLibComm" |
|||
# PROP Intermediate_Dir "..\..\Intermediate\6\Release\LgLibComm" |
|||
# PROP Target_Dir "" |
|||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Yu"stdafx.h" /FD /c |
|||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Yu"stdafx.h" /FD /c |
|||
# ADD BASE RSC /l 0x409 /d "NDEBUG" |
|||
# ADD RSC /l 0x409 /d "NDEBUG" |
|||
BSC32=bscmake.exe |
|||
# ADD BASE BSC32 /nologo |
|||
# ADD BSC32 /nologo |
|||
LIB32=link.exe -lib |
|||
# ADD BASE LIB32 /nologo |
|||
# ADD LIB32 /nologo /out:"..\..\Intermediate\6\LgLibComm.lib" |
|||
|
|||
!ELSEIF "$(CFG)" == "LgLibComm - Win32 Debug" |
|||
|
|||
# PROP BASE Use_MFC 0 |
|||
# PROP BASE Use_Debug_Libraries 1 |
|||
# PROP BASE Output_Dir "Debug" |
|||
# PROP BASE Intermediate_Dir "Debug" |
|||
# PROP BASE Target_Dir "" |
|||
# PROP Use_MFC 0 |
|||
# PROP Use_Debug_Libraries 1 |
|||
# PROP Output_Dir "..\..\Intermediate\6\Debug\LgLibComm" |
|||
# PROP Intermediate_Dir "..\..\Intermediate\6\Debug\LgLibComm" |
|||
# PROP Target_Dir "" |
|||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Yu"stdafx.h" /FD /GZ /c |
|||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /Yu"stdafx.h" /FD /GZ /c |
|||
# SUBTRACT CPP /O<none> |
|||
# ADD BASE RSC /l 0x409 /d "_DEBUG" |
|||
# ADD RSC /l 0x409 /d "_DEBUG" |
|||
BSC32=bscmake.exe |
|||
# ADD BASE BSC32 /nologo |
|||
# ADD BSC32 /nologo |
|||
LIB32=link.exe -lib |
|||
# ADD BASE LIB32 /nologo |
|||
# ADD LIB32 /nologo /out:"..\..\Intermediate\6\LgLibCommD.lib" |
|||
|
|||
!ENDIF |
|||
|
|||
# Begin Target |
|||
|
|||
# Name "LgLibComm - Win32 Release" |
|||
# Name "LgLibComm - Win32 Debug" |
|||
# Begin Group "Source Files" |
|||
|
|||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PMic1300.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PNesher.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\ProtLGSm.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\Protocol.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\ProtocolCCC.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\ProtPTZm.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTKS576.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZAD.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZChina.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZFlir.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZPelco.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZPG3AD.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZVicon.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\RS232.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\RS485.cpp |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\StdAfx.cpp |
|||
# ADD CPP /Yc"stdafx.h" |
|||
# End Source File |
|||
# End Group |
|||
# Begin Group "Header Files" |
|||
|
|||
# PROP Default_Filter "h;hpp;hxx;hm;inl" |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\CLDm.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\Connect.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\Hebron.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\LGSm.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\MIC1300m.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PMic1300.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PNesher.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\ProtLGSm.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\Protocol.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\ProtocolCCC.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\ProtPTZm.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTKS576.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZAD.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZChina.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZFlir.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZm.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZPelco.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZPG3AD.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\PTZVicon.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\RS232.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\RS485.h |
|||
# End Source File |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\StdAfx.h |
|||
# End Source File |
|||
# End Group |
|||
# Begin Source File |
|||
|
|||
SOURCE=.\Readme.txt |
|||
# End Source File |
|||
# End Target |
|||
# End Project |
|||
@ -0,0 +1,47 @@ |
|||
<html> |
|||
<body> |
|||
<pre> |
|||
<h1>Build Log</h1> |
|||
<h3> |
|||
--------------------Configuration: LgLibComm - Win32 Debug-------------------- |
|||
</h3> |
|||
<h3>Command Lines</h3> |
|||
Creating temporary file "C:\Users\Evgeny\AppData\Local\Temp\RSP68CF.tmp" with contents |
|||
[ |
|||
/nologo /MDd /W3 /Gm /GX /ZI /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR"..\..\Intermediate\6\Debug\LgLibComm/" /Fp"..\..\Intermediate\6\Debug\LgLibComm/LgLibComm.pch" /Yu"stdafx.h" /Fo"..\..\Intermediate\6\Debug\LgLibComm/" /Fd"..\..\Intermediate\6\Debug\LgLibComm/" /FD /GZ /c |
|||
"C:\Sources\LgLib\Comm\PTZFlir.cpp" |
|||
] |
|||
Creating command line "cl.exe @C:\Users\Evgeny\AppData\Local\Temp\RSP68CF.tmp" |
|||
Creating temporary file "C:\Users\Evgeny\AppData\Local\Temp\RSP68D0.tmp" with contents |
|||
[ |
|||
/nologo /out:"..\..\Intermediate\6\LgLibCommD.lib" |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PMic1300.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PNesher.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\ProtLGSm.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\Protocol.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\ProtocolCCC.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\ProtPTZm.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PTKS576.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PTZAD.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PTZChina.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PTZFlir.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PTZPelco.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PTZPG3AD.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\PTZVicon.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\RS232.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\RS485.obj |
|||
\Sources\Intermediate\6\Debug\LgLibComm\StdAfx.obj |
|||
] |
|||
Creating command line "link.exe -lib @C:\Users\Evgeny\AppData\Local\Temp\RSP68D0.tmp" |
|||
<h3>Output Window</h3> |
|||
Compiling... |
|||
PTZFlir.cpp |
|||
Creating library... |
|||
|
|||
|
|||
|
|||
<h3>Results</h3> |
|||
LgLibCommD.lib - 0 error(s), 0 warning(s) |
|||
</pre> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,533 @@ |
|||
<?xml version="1.0" encoding="Windows-1252"?> |
|||
<VisualStudioProject |
|||
ProjectType="Visual C++" |
|||
Version="8.00" |
|||
Name="LgLibComm" |
|||
ProjectGUID="{E2858093-08D1-452D-AF74-D8F64421FC74}" |
|||
> |
|||
<Platforms> |
|||
<Platform |
|||
Name="Win32" |
|||
/> |
|||
</Platforms> |
|||
<ToolFiles> |
|||
</ToolFiles> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
OutputDirectory=".\..\..\Intermediate\6\Debug\LgLibComm" |
|||
IntermediateDirectory=".\..\..\Intermediate\6\Debug\LgLibComm" |
|||
ConfigurationType="4" |
|||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" |
|||
UseOfMFC="0" |
|||
ATLMinimizesCRunTimeLibraryUsage="false" |
|||
CharacterSet="2" |
|||
> |
|||
<Tool |
|||
Name="VCPreBuildEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCustomBuildTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXMLDataGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCMIDLTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
Optimization="0" |
|||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB" |
|||
MinimalRebuild="true" |
|||
BasicRuntimeChecks="3" |
|||
RuntimeLibrary="3" |
|||
TreatWChar_tAsBuiltInType="false" |
|||
ForceConformanceInForLoopScope="false" |
|||
RuntimeTypeInfo="false" |
|||
UsePrecompiledHeader="2" |
|||
PrecompiledHeaderThrough="stdafx.h" |
|||
PrecompiledHeaderFile=".\..\..\Intermediate\6\Debug\LgLibComm/LgLibComm.pch" |
|||
AssemblerListingLocation=".\..\..\Intermediate\6\Debug\LgLibComm/" |
|||
ObjectFile=".\..\..\Intermediate\6\Debug\LgLibComm/" |
|||
ProgramDataBaseFileName=".\..\..\Intermediate\6\Debug\LgLibComm/" |
|||
WarningLevel="3" |
|||
SuppressStartupBanner="true" |
|||
DebugInformationFormat="4" |
|||
/> |
|||
<Tool |
|||
Name="VCManagedResourceCompilerTool" |
|||
/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
PreprocessorDefinitions="_DEBUG" |
|||
Culture="1033" |
|||
/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
OutputFile="..\..\Intermediate\6\LgLibCommD.lib" |
|||
SuppressStartupBanner="true" |
|||
/> |
|||
<Tool |
|||
Name="VCALinkTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXDCMakeTool" |
|||
/> |
|||
<Tool |
|||
Name="VCBscMakeTool" |
|||
SuppressStartupBanner="true" |
|||
OutputFile=".\..\..\Intermediate\6\Debug\LgLibComm/LgLibComm.bsc" |
|||
/> |
|||
<Tool |
|||
Name="VCFxCopTool" |
|||
/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool" |
|||
/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
OutputDirectory=".\..\..\Intermediate\6\Release\LgLibComm" |
|||
IntermediateDirectory=".\..\..\Intermediate\6\Release\LgLibComm" |
|||
ConfigurationType="4" |
|||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" |
|||
UseOfMFC="0" |
|||
ATLMinimizesCRunTimeLibraryUsage="false" |
|||
CharacterSet="2" |
|||
> |
|||
<Tool |
|||
Name="VCPreBuildEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCustomBuildTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXMLDataGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCMIDLTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
Optimization="2" |
|||
InlineFunctionExpansion="1" |
|||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB" |
|||
StringPooling="true" |
|||
RuntimeLibrary="0" |
|||
EnableFunctionLevelLinking="true" |
|||
TreatWChar_tAsBuiltInType="false" |
|||
ForceConformanceInForLoopScope="false" |
|||
RuntimeTypeInfo="false" |
|||
UsePrecompiledHeader="2" |
|||
PrecompiledHeaderThrough="stdafx.h" |
|||
PrecompiledHeaderFile=".\..\..\Intermediate\6\Release\LgLibComm/LgLibComm.pch" |
|||
AssemblerListingLocation=".\..\..\Intermediate\6\Release\LgLibComm/" |
|||
ObjectFile=".\..\..\Intermediate\6\Release\LgLibComm/" |
|||
ProgramDataBaseFileName=".\..\..\Intermediate\6\Release\LgLibComm/" |
|||
WarningLevel="3" |
|||
SuppressStartupBanner="true" |
|||
/> |
|||
<Tool |
|||
Name="VCManagedResourceCompilerTool" |
|||
/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
PreprocessorDefinitions="NDEBUG" |
|||
Culture="1033" |
|||
/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
OutputFile="..\..\Intermediate\6\LgLibComm.lib" |
|||
SuppressStartupBanner="true" |
|||
/> |
|||
<Tool |
|||
Name="VCALinkTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXDCMakeTool" |
|||
/> |
|||
<Tool |
|||
Name="VCBscMakeTool" |
|||
SuppressStartupBanner="true" |
|||
OutputFile=".\..\..\Intermediate\6\Release\LgLibComm/LgLibComm.bsc" |
|||
/> |
|||
<Tool |
|||
Name="VCFxCopTool" |
|||
/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool" |
|||
/> |
|||
</Configuration> |
|||
</Configurations> |
|||
<References> |
|||
</References> |
|||
<Files> |
|||
<Filter |
|||
Name="Source Files" |
|||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
|||
> |
|||
<File |
|||
RelativePath="PMic1300.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="ProtLGSm.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="Protocol.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="ProtocolCCC.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="ProtPTZm.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="PTKS576.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZAD.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZPelco.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZPG3AD.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZVicon.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="RS232.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="RS485.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
<File |
|||
RelativePath="StdAfx.cpp" |
|||
> |
|||
<FileConfiguration |
|||
Name="Debug|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
UsePrecompiledHeader="1" |
|||
/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32" |
|||
> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
PreprocessorDefinitions="" |
|||
UsePrecompiledHeader="1" |
|||
/> |
|||
</FileConfiguration> |
|||
</File> |
|||
</Filter> |
|||
<Filter |
|||
Name="Header Files" |
|||
Filter="h;hpp;hxx;hm;inl" |
|||
> |
|||
<File |
|||
RelativePath="CLDm.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="Connect.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="Hebron.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="LGSm.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="MIC1300m.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="PMic1300.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="ProtLGSm.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="Protocol.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="ProtocolCCC.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="ProtPTZm.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="PTKS576.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZAD.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZm.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZPelco.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZPG3AD.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="PTZVicon.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="RS232.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="RS485.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath="StdAfx.h" |
|||
> |
|||
</File> |
|||
</Filter> |
|||
<File |
|||
RelativePath="Readme.txt" |
|||
> |
|||
</File> |
|||
</Files> |
|||
<Globals> |
|||
</Globals> |
|||
</VisualStudioProject> |
|||
@ -0,0 +1,65 @@ |
|||
<?xml version="1.0" encoding="Windows-1252"?> |
|||
<VisualStudioUserFile |
|||
ProjectType="Visual C++" |
|||
Version="8.00" |
|||
ShowAllFiles="false" |
|||
> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
> |
|||
<DebugSettings |
|||
Command="" |
|||
WorkingDirectory="" |
|||
CommandArguments="" |
|||
Attach="false" |
|||
DebuggerType="3" |
|||
Remote="1" |
|||
RemoteMachine="DUALCORE" |
|||
RemoteCommand="" |
|||
HttpUrl="" |
|||
PDBPath="" |
|||
SQLDebugging="" |
|||
Environment="" |
|||
EnvironmentMerge="true" |
|||
DebuggerFlavor="" |
|||
MPIRunCommand="" |
|||
MPIRunArguments="" |
|||
MPIRunWorkingDirectory="" |
|||
ApplicationCommand="" |
|||
ApplicationArguments="" |
|||
ShimCommand="" |
|||
MPIAcceptMode="" |
|||
MPIAcceptFilter="" |
|||
/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
> |
|||
<DebugSettings |
|||
Command="" |
|||
WorkingDirectory="" |
|||
CommandArguments="" |
|||
Attach="false" |
|||
DebuggerType="3" |
|||
Remote="1" |
|||
RemoteMachine="DUALCORE" |
|||
RemoteCommand="" |
|||
HttpUrl="" |
|||
PDBPath="" |
|||
SQLDebugging="" |
|||
Environment="" |
|||
EnvironmentMerge="true" |
|||
DebuggerFlavor="" |
|||
MPIRunCommand="" |
|||
MPIRunArguments="" |
|||
MPIRunWorkingDirectory="" |
|||
ApplicationCommand="" |
|||
ApplicationArguments="" |
|||
ShimCommand="" |
|||
MPIAcceptMode="" |
|||
MPIAcceptFilter="" |
|||
/> |
|||
</Configuration> |
|||
</Configurations> |
|||
</VisualStudioUserFile> |
|||
@ -0,0 +1,65 @@ |
|||
<?xml version="1.0" encoding="windows-1255"?> |
|||
<VisualStudioUserFile |
|||
ProjectType="Visual C++" |
|||
Version="8.00" |
|||
ShowAllFiles="false" |
|||
> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
> |
|||
<DebugSettings |
|||
Command="" |
|||
WorkingDirectory="" |
|||
CommandArguments="" |
|||
Attach="false" |
|||
DebuggerType="3" |
|||
Remote="1" |
|||
RemoteMachine="P2600HT" |
|||
RemoteCommand="" |
|||
HttpUrl="" |
|||
PDBPath="" |
|||
SQLDebugging="" |
|||
Environment="" |
|||
EnvironmentMerge="true" |
|||
DebuggerFlavor="" |
|||
MPIRunCommand="" |
|||
MPIRunArguments="" |
|||
MPIRunWorkingDirectory="" |
|||
ApplicationCommand="" |
|||
ApplicationArguments="" |
|||
ShimCommand="" |
|||
MPIAcceptMode="" |
|||
MPIAcceptFilter="" |
|||
/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
> |
|||
<DebugSettings |
|||
Command="" |
|||
WorkingDirectory="" |
|||
CommandArguments="" |
|||
Attach="false" |
|||
DebuggerType="3" |
|||
Remote="1" |
|||
RemoteMachine="P2600HT" |
|||
RemoteCommand="" |
|||
HttpUrl="" |
|||
PDBPath="" |
|||
SQLDebugging="" |
|||
Environment="" |
|||
EnvironmentMerge="true" |
|||
DebuggerFlavor="" |
|||
MPIRunCommand="" |
|||
MPIRunArguments="" |
|||
MPIRunWorkingDirectory="" |
|||
ApplicationCommand="" |
|||
ApplicationArguments="" |
|||
ShimCommand="" |
|||
MPIAcceptMode="" |
|||
MPIAcceptFilter="" |
|||
/> |
|||
</Configuration> |
|||
</Configurations> |
|||
</VisualStudioUserFile> |
|||
@ -0,0 +1,204 @@ |
|||
<?xml version="1.0" encoding = "Windows-1252"?> |
|||
<VisualStudioProject |
|||
ProjectType="Visual C++" |
|||
Version="7.00" |
|||
Name="LgLibComm" |
|||
SccProjectName="" |
|||
SccLocalPath=""> |
|||
<Platforms> |
|||
<Platform |
|||
Name="Win32"/> |
|||
</Platforms> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
OutputDirectory=".\..\..\Intermediate\7\Debug\LgLibComm" |
|||
IntermediateDirectory=".\..\..\Intermediate\7\Debug\LgLibComm" |
|||
ConfigurationType="4" |
|||
UseOfMFC="0" |
|||
ATLMinimizesCRunTimeLibraryUsage="FALSE" |
|||
CharacterSet="2"> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
Optimization="0" |
|||
PreprocessorDefinitions="WIN32,_DEBUG,_LIB" |
|||
BasicRuntimeChecks="3" |
|||
RuntimeLibrary="3" |
|||
UsePrecompiledHeader="3" |
|||
PrecompiledHeaderThrough="stdafx.h" |
|||
PrecompiledHeaderFile=".\..\..\Intermediate\7\Debug\LgLibComm/LgLibComm.pch" |
|||
AssemblerListingLocation=".\..\..\Intermediate\7\Debug\LgLibComm/" |
|||
ObjectFile=".\..\..\Intermediate\7\Debug\LgLibComm/" |
|||
ProgramDataBaseFileName=".\..\..\Intermediate\7\Debug\LgLibComm/" |
|||
WarningLevel="3" |
|||
SuppressStartupBanner="TRUE" |
|||
DebugInformationFormat="4"/> |
|||
<Tool |
|||
Name="VCCustomBuildTool"/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
OutputFile="..\..\Intermediate\7\LgLibCommD.lib" |
|||
SuppressStartupBanner="TRUE"/> |
|||
<Tool |
|||
Name="VCMIDLTool"/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool"/> |
|||
<Tool |
|||
Name="VCPreBuildEventTool"/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool"/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
PreprocessorDefinitions="_DEBUG" |
|||
Culture="1033"/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool"/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
OutputDirectory=".\..\..\Intermediate\7\Release\LgLibComm" |
|||
IntermediateDirectory=".\..\..\Intermediate\7\Release\LgLibComm" |
|||
ConfigurationType="4" |
|||
UseOfMFC="0" |
|||
ATLMinimizesCRunTimeLibraryUsage="FALSE" |
|||
CharacterSet="2"> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
InlineFunctionExpansion="1" |
|||
PreprocessorDefinitions="WIN32,NDEBUG,_LIB" |
|||
StringPooling="TRUE" |
|||
RuntimeLibrary="0" |
|||
EnableFunctionLevelLinking="TRUE" |
|||
UsePrecompiledHeader="3" |
|||
PrecompiledHeaderThrough="stdafx.h" |
|||
PrecompiledHeaderFile=".\..\..\Intermediate\7\Release\LgLibComm/LgLibComm.pch" |
|||
AssemblerListingLocation=".\..\..\Intermediate\7\Release\LgLibComm/" |
|||
ObjectFile=".\..\..\Intermediate\7\Release\LgLibComm/" |
|||
ProgramDataBaseFileName=".\..\..\Intermediate\7\Release\LgLibComm/" |
|||
WarningLevel="3" |
|||
SuppressStartupBanner="TRUE"/> |
|||
<Tool |
|||
Name="VCCustomBuildTool"/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
OutputFile="..\..\Intermediate\7\LgLibComm.lib" |
|||
SuppressStartupBanner="TRUE"/> |
|||
<Tool |
|||
Name="VCMIDLTool"/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool"/> |
|||
<Tool |
|||
Name="VCPreBuildEventTool"/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool"/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
PreprocessorDefinitions="NDEBUG" |
|||
Culture="1033"/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool"/> |
|||
</Configuration> |
|||
</Configurations> |
|||
<Files> |
|||
<Filter |
|||
Name="Source Files" |
|||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> |
|||
<File |
|||
RelativePath=".\PMic1300.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\PTKS576.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\PTZPG3AD.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\ProtLGSm.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\ProtPTZm.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\Protocol.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\ProtocolCCC.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\RS232.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\RS485.cpp"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\StdAfx.cpp"> |
|||
<FileConfiguration |
|||
Name="Debug|Win32"> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
UsePrecompiledHeader="1"/> |
|||
</FileConfiguration> |
|||
<FileConfiguration |
|||
Name="Release|Win32"> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
UsePrecompiledHeader="1"/> |
|||
</FileConfiguration> |
|||
</File> |
|||
</Filter> |
|||
<Filter |
|||
Name="Header Files" |
|||
Filter="h;hpp;hxx;hm;inl"> |
|||
<File |
|||
RelativePath=".\CLDm.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\Connect.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\LGSm.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\MIC1300m.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\PMic1300.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\PTKS576.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\PTZPG3AD.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\PTZm.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\ProtLGSm.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\ProtPTZm.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\Protocol.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\ProtocolCCC.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\RS232.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\RS485.h"> |
|||
</File> |
|||
<File |
|||
RelativePath=".\StdAfx.h"> |
|||
</File> |
|||
</Filter> |
|||
<File |
|||
RelativePath=".\Readme.txt"> |
|||
</File> |
|||
</Files> |
|||
<Globals> |
|||
</Globals> |
|||
</VisualStudioProject> |
|||
@ -0,0 +1,10 @@ |
|||
"" |
|||
{ |
|||
"FILE_VERSION" = "9237" |
|||
"ENLISTMENT_CHOICE" = "NEVER" |
|||
"PROJECT_FILE_RELATIVE_PATH" = "relative:LgLib\\Comm" |
|||
"NUMBER_OF_EXCLUDED_FILES" = "0" |
|||
"ORIGINAL_PROJECT_FILE_PATH" = "" |
|||
"NUMBER_OF_NESTED_PROJECTS" = "0" |
|||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" |
|||
} |
|||
@ -0,0 +1,182 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Template|Win32"> |
|||
<Configuration>Template</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<SccProjectName>"$/System/System", TRFAAAAA</SccProjectName> |
|||
<SccLocalPath>..\..\system</SccLocalPath> |
|||
<ProjectGuid>{19ABF195-E66D-4A0D-A033-6E33DD5F8E45}</ProjectGuid> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<PlatformToolset>v142</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<PlatformToolset>v142</PlatformToolset> |
|||
<UseOfMfc>false</UseOfMfc> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<PlatformToolset>v142</PlatformToolset> |
|||
<UseOfMfc>false</UseOfMfc> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<OutDir>.\..\..\Intermediate\6\Debug\LgLibComm\</OutDir> |
|||
<IntDir>.\..\..\Intermediate\6\Debug\LgLibComm\</IntDir> |
|||
<LinkIncremental>true</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<OutDir>.\..\..\Intermediate\6\Release\LgLibComm\</OutDir> |
|||
<IntDir>.\..\..\Intermediate\6\Release\LgLibComm\</IntDir> |
|||
<LinkIncremental>false</LinkIncremental> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> |
|||
<InlineFunctionExpansion>Default</InlineFunctionExpansion> |
|||
<FunctionLevelLinking> |
|||
</FunctionLevelLinking> |
|||
<Optimization>Disabled</Optimization> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<MinimalRebuild> |
|||
</MinimalRebuild> |
|||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<AssemblerListingLocation>.\..\..\Intermediate\6\Debug\LgLibComm\</AssemblerListingLocation> |
|||
<BrowseInformation>true</BrowseInformation> |
|||
<PrecompiledHeaderOutputFile>.\..\..\Intermediate\6\Debug\LgLibComm\LgLibComm.pch</PrecompiledHeaderOutputFile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile> |
|||
<ObjectFileName>.\..\..\Intermediate\6\Debug\LgLibComm\</ObjectFileName> |
|||
<ProgramDataBaseFileName>.\..\..\Intermediate\6\Debug\LgLibComm\</ProgramDataBaseFileName> |
|||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
|||
</ClCompile> |
|||
<ResourceCompile> |
|||
<Culture>0x0409</Culture> |
|||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
</ResourceCompile> |
|||
<Bscmake> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<OutputFile>.\..\..\Intermediate\6\Debug\LgLibComm\LgLibComm.bsc</OutputFile> |
|||
</Bscmake> |
|||
<Lib> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<OutputFile>..\..\Intermediate\6\LgLibCommD.lib</OutputFile> |
|||
</Lib> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<InlineFunctionExpansion>Default</InlineFunctionExpansion> |
|||
<StringPooling>true</StringPooling> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<AssemblerListingLocation>.\..\..\Intermediate\6\Release\LgLibComm\</AssemblerListingLocation> |
|||
<PrecompiledHeaderOutputFile>.\..\..\Intermediate\6\Release\LgLibComm\LgLibComm.pch</PrecompiledHeaderOutputFile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile> |
|||
<ObjectFileName>.\..\..\Intermediate\6\Release\LgLibComm\</ObjectFileName> |
|||
<ProgramDataBaseFileName>.\..\..\Intermediate\6\Release\LgLibComm\</ProgramDataBaseFileName> |
|||
</ClCompile> |
|||
<ResourceCompile> |
|||
<Culture>0x0409</Culture> |
|||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
</ResourceCompile> |
|||
<Bscmake> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<OutputFile>.\..\..\Intermediate\6\Release\LgLibComm\LgLibComm.bsc</OutputFile> |
|||
</Bscmake> |
|||
<Lib> |
|||
<SuppressStartupBanner>true</SuppressStartupBanner> |
|||
<OutputFile>..\..\Intermediate\6\LgLibComm.lib</OutputFile> |
|||
</Lib> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="PMic1300.cpp" /> |
|||
<ClCompile Include="PNesher.cpp" /> |
|||
<ClCompile Include="ProtLGSm.cpp" /> |
|||
<ClCompile Include="Protocol.cpp" /> |
|||
<ClCompile Include="ProtocolCCC.cpp" /> |
|||
<ClCompile Include="ProtPTZm.cpp" /> |
|||
<ClCompile Include="PTKS576.cpp" /> |
|||
<ClCompile Include="PTZAD.cpp" /> |
|||
<ClCompile Include="PTZChina.cpp" /> |
|||
<ClCompile Include="PTZFlir.cpp" /> |
|||
<ClCompile Include="PTZPelco.cpp" /> |
|||
<ClCompile Include="PTZPG3AD.cpp" /> |
|||
<ClCompile Include="PTZVicon.cpp" /> |
|||
<ClCompile Include="RS232.cpp" /> |
|||
<ClCompile Include="RS485.cpp" /> |
|||
<ClCompile Include="StdAfx.cpp"> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdafx.h</PrecompiledHeaderFile> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdafx.h</PrecompiledHeaderFile> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="CLDm.h" /> |
|||
<ClInclude Include="Connect.h" /> |
|||
<ClInclude Include="Hebron.h" /> |
|||
<ClInclude Include="LGSm.h" /> |
|||
<ClInclude Include="MIC1300m.h" /> |
|||
<ClInclude Include="PMic1300.h" /> |
|||
<ClInclude Include="PNesher.h" /> |
|||
<ClInclude Include="ProtLGSm.h" /> |
|||
<ClInclude Include="Protocol.h" /> |
|||
<ClInclude Include="ProtocolCCC.h" /> |
|||
<ClInclude Include="ProtPTZm.h" /> |
|||
<ClInclude Include="PTKS576.h" /> |
|||
<ClInclude Include="PTZAD.h" /> |
|||
<ClInclude Include="PTZChina.h" /> |
|||
<ClInclude Include="PTZFlir.h" /> |
|||
<ClInclude Include="PTZm.h" /> |
|||
<ClInclude Include="PTZPelco.h" /> |
|||
<ClInclude Include="PTZPG3AD.h" /> |
|||
<ClInclude Include="PTZVicon.h" /> |
|||
<ClInclude Include="RS232.h" /> |
|||
<ClInclude Include="RS485.h" /> |
|||
<ClInclude Include="StdAfx.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Text Include="Readme.txt" /> |
|||
</ItemGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
|||
@ -0,0 +1,134 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<Filter Include="Source Files"> |
|||
<UniqueIdentifier>{9ef52490-372f-49d9-b835-06757c8df0a6}</UniqueIdentifier> |
|||
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions> |
|||
</Filter> |
|||
<Filter Include="Header Files"> |
|||
<UniqueIdentifier>{244c4f12-dac6-415a-bf15-6116c7772095}</UniqueIdentifier> |
|||
<Extensions>h;hpp;hxx;hm;inl</Extensions> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="PMic1300.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="PNesher.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="ProtLGSm.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="Protocol.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="ProtocolCCC.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="ProtPTZm.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="PTKS576.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="PTZAD.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="PTZChina.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="PTZFlir.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="PTZPelco.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="PTZPG3AD.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="PTZVicon.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="RS232.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="RS485.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="StdAfx.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="CLDm.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="Connect.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="Hebron.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="LGSm.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="MIC1300m.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PMic1300.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PNesher.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="ProtLGSm.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="Protocol.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="ProtocolCCC.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="ProtPTZm.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PTKS576.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PTZAD.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PTZChina.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PTZFlir.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PTZm.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PTZPelco.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PTZPG3AD.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="PTZVicon.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="RS232.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="RS485.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="StdAfx.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Text Include="Readme.txt" /> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,3 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
</Project> |
|||
@ -0,0 +1,470 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: MIC1300m.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZ_MIC_1_300 |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
#ifndef __MIC_1_300__PTZ__H__INCLUDED__ |
|||
#define __MIC_1_300__PTZ__H__INCLUDED__ |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
//#define MIC_TILT_DEAD_ZONE 0x484L |
|||
#define MIC_TILT_DEAD_ZONE 0x4C4L |
|||
#define BASIS_SHIFT 104.0 // 90.0 + 42.0/2 degrees |
|||
|
|||
struct PTZ_MIC_1_300 |
|||
{ |
|||
// types |
|||
public: |
|||
typedef struct |
|||
{ |
|||
BOOL bZoomOn; |
|||
BOOL bZoomWide; |
|||
BOOL bTiltOn; |
|||
BOOL bTiltDown; |
|||
BOOL bPanOn; |
|||
BOOL bPanRight; |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
BOOL bLampsOn; |
|||
BOOL bWiperOn; |
|||
}CONTROL_STATUS, *PCONTROL_STATUS; |
|||
// constants |
|||
public: |
|||
enum { CF_FULL_DUPLEX = '6', CF_HALF_DUPLEX = '4', CF_SIMPLEX = '2' }; |
|||
|
|||
// commands |
|||
public: |
|||
static INT BuildGotoPosition( LPBYTE pBuffer, BYTE bAddress, WORD wPan, WORD wTilt, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 20, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 20, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'N'; // control code (command) |
|||
pBuffer[ 7] = ToAscii( wPan, 2 ); // pan |
|||
pBuffer[ 8] = ToAscii( wPan, 1 ); // --||-- |
|||
pBuffer[ 9] = ToAscii( wPan, 0 ); // --||-- |
|||
pBuffer[10] = ToAscii( wTilt, 2 ); // tilt |
|||
pBuffer[11] = ToAscii( wTilt, 1 ); // --||-- |
|||
pBuffer[12] = ToAscii( wTilt, 0 ); // --||-- |
|||
pBuffer[13] = ToAscii( wZoom, 2 ); // zoom |
|||
pBuffer[14] = ToAscii( wZoom, 1 ); // --||-- |
|||
pBuffer[15] = ToAscii( wZoom, 0 ); // --||-- |
|||
pBuffer[16] = '0'; // unsupported |
|||
pBuffer[17] = '0'; // --||-- |
|||
pBuffer[18] = '0'; // --||-- |
|||
return CheckSum( pBuffer, 20 ); |
|||
} |
|||
|
|||
static INT BuildGetPosition( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 8, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 8, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'O'; // control code (command) |
|||
return CheckSum( pBuffer, 8 ); |
|||
} |
|||
|
|||
static INT BuildGetConfig( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 8, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 8, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'a'; // control code (command) |
|||
return CheckSum( pBuffer, 8 ); |
|||
} |
|||
|
|||
static INT BuildSetConfig( LPBYTE pBuffer, BYTE bAddress, BYTE bConfig ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 10, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 10, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'q'; // control code (command) |
|||
pBuffer[ 7] = ToAscii( bConfig, 1 ); // config |
|||
pBuffer[ 8] = ToAscii( bConfig, 0 ); // --||-- |
|||
return CheckSum( pBuffer, 10 ); |
|||
} |
|||
|
|||
static INT BuildSetAddress( LPBYTE pBuffer, BYTE bAddress, BYTE bNewAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 10, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 10, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 's'; // control code (command) |
|||
pBuffer[ 7] = ToAscii( bNewAddress, 1 );// new address |
|||
pBuffer[ 8] = ToAscii( bNewAddress, 0 );// --||-- |
|||
return CheckSum( pBuffer, 10 ); |
|||
} |
|||
|
|||
static INT BuildGetStatus( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 8, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 8, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'H'; // control code (command) |
|||
return CheckSum( pBuffer, 8 ); |
|||
} |
|||
|
|||
static INT BuildSetManualControl( LPBYTE pBuffer, BYTE bAddress, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 18, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 18, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'G'; // control code (command) |
|||
|
|||
BYTE bCmd = 0; |
|||
if( pStatus->bPanRight ) bCmd |= 0x01; |
|||
if( pStatus->bPanOn ) bCmd |= 0x02; |
|||
if( pStatus->bTiltDown ) bCmd |= 0x04; |
|||
if( pStatus->bTiltOn ) bCmd |= 0x08; |
|||
if( pStatus->bZoomWide ) bCmd |= 0x10; |
|||
if( pStatus->bZoomOn ) bCmd |= 0x20; |
|||
|
|||
pBuffer[ 7] = ToAscii( bCmd, 1 ); // command |
|||
pBuffer[ 8] = ToAscii( bCmd, 0 ); // --||-- |
|||
pBuffer[ 9] = ToAscii( 0xB2, 1 ); // auto iris + fast zoom |
|||
pBuffer[10] = ToAscii( 0xB2, 0 ); // --||-- |
|||
|
|||
bCmd = 0x02; |
|||
if( pStatus->bLampsOn ) bCmd |= 0x18; |
|||
if( pStatus->bWiperOn ) bCmd |= 0x40; |
|||
|
|||
pBuffer[11] = ToAscii( bCmd, 1 ); // digital zoom |
|||
pBuffer[12] = ToAscii( bCmd, 0 ); // --||-- |
|||
pBuffer[13] = ToAscii( pStatus->bPanSpeed, 1 ); // pan speed |
|||
pBuffer[14] = ToAscii( pStatus->bPanSpeed, 0 ); // --||-- |
|||
pBuffer[15] = ToAscii( pStatus->bTiltSpeed, 1 ); // unused |
|||
pBuffer[16] = ToAscii( pStatus->bTiltSpeed, 0 ); // --||-- |
|||
return CheckSum( pBuffer, 18 ); |
|||
} |
|||
|
|||
static INT BuildSetManualControlPZ( LPBYTE pBuffer, BYTE bAddress, PCONTROL_STATUS pStatus, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 24, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 24, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'w'; // control code (command) |
|||
|
|||
BYTE bCmd = 0; |
|||
if( pStatus->bPanRight ) bCmd |= 0x01; |
|||
if( pStatus->bPanOn ) bCmd |= 0x02; |
|||
if( pStatus->bTiltDown ) bCmd |= 0x04; |
|||
if( pStatus->bTiltOn ) bCmd |= 0x08; |
|||
if( pStatus->bZoomWide ) bCmd |= 0x10; |
|||
if( pStatus->bZoomOn ) bCmd |= 0x20; |
|||
|
|||
pBuffer[ 7] = ToAscii( bCmd, 1 ); // command |
|||
pBuffer[ 8] = ToAscii( bCmd, 0 ); // --||-- |
|||
pBuffer[ 9] = ToAscii( 0x32, 1 ); // auto iris + fast zoom |
|||
pBuffer[10] = ToAscii( 0x32, 0 ); // --||-- |
|||
|
|||
bCmd = 0x02; |
|||
if( pStatus->bLampsOn ) bCmd |= 0x18; |
|||
if( pStatus->bWiperOn ) bCmd |= 0x40; |
|||
|
|||
pBuffer[11] = ToAscii( bCmd, 1 ); // digital zoom |
|||
pBuffer[12] = ToAscii( bCmd, 0 ); // --||-- |
|||
pBuffer[13] = ToAscii( pStatus->bPanSpeed, 1 ); // pan speed |
|||
pBuffer[14] = ToAscii( pStatus->bPanSpeed, 0 ); // --||-- |
|||
pBuffer[15] = ToAscii( pStatus->bTiltSpeed, 1 ); // unused |
|||
pBuffer[16] = ToAscii( pStatus->bTiltSpeed, 0 ); // --||-- |
|||
pBuffer[17] = ToAscii( wZoom, 2 ); // absolute zoom position |
|||
pBuffer[18] = ToAscii( wZoom, 1 ); // --||-- |
|||
pBuffer[19] = ToAscii( wZoom, 0 ); // --||-- |
|||
pBuffer[20] = ToAscii( 0x000, 2 ); // focus position (unsupported) |
|||
pBuffer[21] = ToAscii( 0x000, 1 ); // --||-- |
|||
pBuffer[22] = ToAscii( 0x000, 0 ); // --||-- |
|||
return CheckSum( pBuffer, 24 ); |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, BOOL bRight, BYTE bSpeed, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pStatus->bPanOn = bSpeed ? TRUE : FALSE; |
|||
pStatus->bPanRight = bRight; |
|||
pStatus->bPanSpeed = bSpeed; |
|||
return BuildSetManualControl( pBuffer, bAddress, pStatus ); |
|||
} |
|||
|
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, BOOL bUp, BYTE bSpeed, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pStatus->bTiltOn = bSpeed ? TRUE : FALSE; |
|||
pStatus->bTiltDown = !bUp; |
|||
pStatus->bTiltSpeed = bSpeed; |
|||
return BuildSetManualControl( pBuffer, bAddress, pStatus ); |
|||
} |
|||
|
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, BOOL bTele, BYTE bSpeed, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pStatus->bZoomOn = bSpeed ? TRUE : FALSE; |
|||
pStatus->bZoomWide = !bTele; |
|||
return BuildSetManualControl( pBuffer, bAddress, pStatus ); |
|||
} |
|||
|
|||
static INT BuildSetDefaultSettings( LPBYTE pBuffer, BYTE bAddress, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
memset( pStatus, 0, sizeof(CONTROL_STATUS) ); |
|||
return BuildSetManualControl( pBuffer, bAddress, pStatus ); |
|||
} |
|||
|
|||
static INT BuildVisca( LPBYTE pBuffer, BYTE bAddress, PBYTE pCommand, INT nCount ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
nCount <<= 1; |
|||
pBuffer[ 3] = ToAscii( 8 + nCount, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 8 + nCount, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'r'; // control code (command) |
|||
for( INT i = 0; i < nCount; i += 2 ) |
|||
{ |
|||
pBuffer[ i + 7 ] = ToAscii( *pCommand , 1 ); |
|||
pBuffer[ i + 8 ] = ToAscii( *pCommand++, 0 ); |
|||
} |
|||
return CheckSum( pBuffer, 8 + nCount ); |
|||
} |
|||
|
|||
static INT BuildSetSlowShutter( LPBYTE pBuffer, BYTE bAddress, BOOL bAuto ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x5A, (uint8_t)(bAuto ? 0x02 : 0x03), 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetBackLight( LPBYTE pBuffer, BYTE bAddress, BOOL bOn ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x33, (uint8_t)(bOn ? 0x02 : 0x03), 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetLowLux( LPBYTE pBuffer, BYTE bAddress, BOOL bOn ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x01, (uint8_t)(bOn ? 0x02 : 0x03), 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetIRled( LPBYTE pBuffer, BYTE bAddress, BOOL bOn ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x31, (uint8_t)(bOn ? 0x02 : 0x03), 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
/* |
|||
static BYTE SonyChar( BYTE bAscii ) |
|||
{ |
|||
return bAscii - 'A'; |
|||
} |
|||
|
|||
static INT BuildSetTitleClear( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x74, 0x00, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetTitleLowLight( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x73, 0x01, SonyChar( 'L' ), SonyChar( 'O' ), SonyChar( 'W' ), |
|||
0x1B, SonyChar( 'L' ), SonyChar( 'I' ), |
|||
SonyChar( 'G' ), SonyChar( 'H' ), SonyChar( 'T' ), |
|||
0x1B, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetTitleNormalLight1( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x73, 0x01, SonyChar( 'N' ), SonyChar( 'O' ), SonyChar( 'R' ), |
|||
SonyChar( 'M' ), SonyChar( 'A' ), SonyChar( 'L' ), |
|||
0x1B, 0x1B, 0x1B, |
|||
0x1B, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
static INT BuildSetTitleNormalLight2( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x73, 0x02, SonyChar( 'L' ), SonyChar( 'I' ), SonyChar( 'G' ), |
|||
SonyChar( 'H' ), SonyChar( 'T' ), 0x1B, |
|||
0x1B, 0x1B, 0x1B, |
|||
0x1B, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetLowLight( LPBYTE pBuffer, BYTE bAddress, BOOL bLowLight, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pStatus->bLampsOn = bLowLight; |
|||
|
|||
if( bLowLight ) |
|||
{ |
|||
INT nCount = 0; |
|||
nCount += BuildSetSlowShutter( pBuffer + nCount, bAddress, TRUE ); |
|||
nCount += BuildSetBackLight( pBuffer + nCount, bAddress, TRUE ); |
|||
nCount += BuildSetLowLux( pBuffer + nCount, bAddress, TRUE ); |
|||
nCount += BuildSetIRled( pBuffer + nCount, bAddress, TRUE ); |
|||
// nCount += BuildSetTitleClear( pBuffer + nCount, bAddress ); |
|||
// nCount += BuildSetTitleLowLight( pBuffer + nCount, bAddress ); |
|||
return nCount; |
|||
} |
|||
|
|||
INT nCount = 0; |
|||
nCount += BuildSetSlowShutter( pBuffer + nCount, bAddress, FALSE ); |
|||
nCount += BuildSetBackLight( pBuffer + nCount, bAddress, FALSE ); |
|||
nCount += BuildSetLowLux( pBuffer + nCount, bAddress, FALSE ); |
|||
nCount += BuildSetIRled( pBuffer + nCount, bAddress, FALSE ); |
|||
// nCount += BuildSetTitleClear( pBuffer + nCount, bAddress ); |
|||
// nCount += BuildSetTitleNormalLight1( pBuffer + nCount, bAddress ); |
|||
// nCount += BuildSetTitleNormalLight2( pBuffer + nCount, bAddress ); |
|||
return nCount; |
|||
} |
|||
*/ |
|||
static INT BuildSetPictureEffect( LPBYTE pBuffer, BYTE bAddress, INT nEffect ) |
|||
{ |
|||
// picture effects |
|||
BYTE pCommand[][6] = |
|||
{ |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x00, 0xFF }, // no effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x01, 0xFF }, // pastel effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x02, 0xFF }, // negative effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x03, 0xFF }, // sepia effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x04, 0xFF }, // B/W effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x05, 0xFF }, // solarize effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x06, 0xFF }, // mosaic effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x07, 0xFF }, // slim effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x08, 0xFF } // stretch effect |
|||
}; |
|||
return BuildVisca( pBuffer, bAddress, pCommand[nEffect], sizeof(pCommand[0]) ); |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan ) |
|||
{ |
|||
return (wPan - 0x001L) * 360L / ( 0x0FFFL - 0x001 ); |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle ) |
|||
{ |
|||
return (WORD)( Angle * ( 0xFFFL - 0x001L ) / 360L + 0x001L ); |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
// return ((double)wTilt - 0x484) * 360.0 / 0xFFF; |
|||
// NP return 360L - ( wTilt - MIC_TILT_DEAD_ZONE ) * 360L / 0xFFFL; |
|||
#ifdef __BORLANDC__ |
|||
return 360L - ( wTilt - 0x484L ) * 360L / 0xFFFL; |
|||
#else |
|||
return (INT)(BASIS_SHIFT - ( wTilt * 360.0 / 4095.0 )); |
|||
#endif |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
// return (WORD)(dAngle * 0xFFF / 360.0 + 0x484); |
|||
// NP return (WORD)( (360L - dAngle) * 0xFFFL / 360L + MIC_TILT_DEAD_ZONE ); |
|||
#ifdef __BORLANDC__ |
|||
return (WORD)( (360L - dAngle) * 0xFFFL / 360L + 0x484L ); |
|||
#else |
|||
return (WORD)( (( dAngle > BASIS_SHIFT )?(360.0+BASIS_SHIFT-dAngle):(BASIS_SHIFT-dAngle))*4095.0/360.0); |
|||
#endif |
|||
} |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (WORD)( dPercent * 0x0923L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom ) |
|||
{ |
|||
return ( wZoom * 100L ) / 0x0923L; |
|||
} |
|||
|
|||
// speed |
|||
static BYTE Percent2Speed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 255L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Speed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 255L; |
|||
} |
|||
|
|||
// helpers |
|||
public: |
|||
static BYTE ToAscii( WORD wValue, BYTE nDigit ) |
|||
{ |
|||
static BYTE pHexTable[] = "0123456789ABCDEF"; |
|||
return pHexTable[ ( wValue >> (nDigit << 2) ) & 0x0F ]; |
|||
} |
|||
static WORD ToValue( PBYTE pAscii, INT nCount ) |
|||
{ |
|||
WORD bValue = 0; |
|||
for( INT i = 0; i < nCount; i++ ) |
|||
{ |
|||
bValue <<= 4; |
|||
if( pAscii[i] >= '0' && pAscii[i] <= '9' ) bValue += (pAscii[i] - '0'); |
|||
else |
|||
if( pAscii[i] >= 'A' && pAscii[i] <= 'F' ) bValue += (pAscii[i] - 'A' + 10); |
|||
else |
|||
if( pAscii[i] >= 'a' && pAscii[i] <= 'f' ) bValue += (pAscii[i] - 'a' + 10); |
|||
} |
|||
return bValue; |
|||
} |
|||
|
|||
private: |
|||
static INT CheckSum( LPBYTE pBuffer, INT nLength ) |
|||
{ |
|||
INT nCount = nLength - 1; |
|||
PBYTE pCheckSum = pBuffer + nCount; |
|||
// XOR all bytes in packet |
|||
*pCheckSum = *pBuffer++; |
|||
while( --nCount ) |
|||
*pCheckSum ^= *pBuffer++; |
|||
// set top bit into '1' |
|||
*pCheckSum |= 0x80; |
|||
return nLength; |
|||
} |
|||
}; |
|||
|
|||
#endif |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
@ -0,0 +1,466 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: MIC1300m.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZ_MIC_1_300 |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
#ifndef __MIC_1_300__PTZ__H__INCLUDED__ |
|||
#define __MIC_1_300__PTZ__H__INCLUDED__ |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
//#define MIC_TILT_DEAD_ZONE 0x484L |
|||
#define MIC_TILT_DEAD_ZONE 0x4C4L |
|||
#define BASIS_SHIFT 104.0 // 90.0 + 42.0/2 degrees |
|||
|
|||
struct PTZ_MIC_1_300 |
|||
{ |
|||
// types |
|||
public: |
|||
typedef struct |
|||
{ |
|||
BOOL bZoomOn; |
|||
BOOL bZoomWide; |
|||
BOOL bTiltOn; |
|||
BOOL bTiltDown; |
|||
BOOL bPanOn; |
|||
BOOL bPanRight; |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
BOOL bLampsOn; |
|||
BOOL bWiperOn; |
|||
}CONTROL_STATUS, *PCONTROL_STATUS; |
|||
// constants |
|||
public: |
|||
enum { CF_FULL_DUPLEX = '6', CF_HALF_DUPLEX = '4', CF_SIMPLEX = '2' }; |
|||
|
|||
// commands |
|||
public: |
|||
static INT BuildGotoPosition( LPBYTE pBuffer, BYTE bAddress, WORD wPan, WORD wTilt, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 20, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 20, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'N'; // control code (command) |
|||
pBuffer[ 7] = ToAscii( wPan, 2 ); // pan |
|||
pBuffer[ 8] = ToAscii( wPan, 1 ); // --||-- |
|||
pBuffer[ 9] = ToAscii( wPan, 0 ); // --||-- |
|||
pBuffer[10] = ToAscii( wTilt, 2 ); // tilt |
|||
pBuffer[11] = ToAscii( wTilt, 1 ); // --||-- |
|||
pBuffer[12] = ToAscii( wTilt, 0 ); // --||-- |
|||
pBuffer[13] = ToAscii( wZoom, 2 ); // zoom |
|||
pBuffer[14] = ToAscii( wZoom, 1 ); // --||-- |
|||
pBuffer[15] = ToAscii( wZoom, 0 ); // --||-- |
|||
pBuffer[16] = '0'; // unsupported |
|||
pBuffer[17] = '0'; // --||-- |
|||
pBuffer[18] = '0'; // --||-- |
|||
return CheckSum( pBuffer, 20 ); |
|||
} |
|||
|
|||
static INT BuildGetPosition( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 8, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 8, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'O'; // control code (command) |
|||
return CheckSum( pBuffer, 8 ); |
|||
} |
|||
|
|||
static INT BuildGetConfig( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 8, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 8, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'a'; // control code (command) |
|||
return CheckSum( pBuffer, 8 ); |
|||
} |
|||
|
|||
static INT BuildSetConfig( LPBYTE pBuffer, BYTE bAddress, BYTE bConfig ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 10, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 10, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'q'; // control code (command) |
|||
pBuffer[ 7] = ToAscii( bConfig, 1 ); // config |
|||
pBuffer[ 8] = ToAscii( bConfig, 0 ); // --||-- |
|||
return CheckSum( pBuffer, 10 ); |
|||
} |
|||
|
|||
static INT BuildSetAddress( LPBYTE pBuffer, BYTE bAddress, BYTE bNewAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 10, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 10, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 's'; // control code (command) |
|||
pBuffer[ 7] = ToAscii( bNewAddress, 1 );// new address |
|||
pBuffer[ 8] = ToAscii( bNewAddress, 0 );// --||-- |
|||
return CheckSum( pBuffer, 10 ); |
|||
} |
|||
|
|||
static INT BuildGetStatus( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 8, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 8, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'H'; // control code (command) |
|||
return CheckSum( pBuffer, 8 ); |
|||
} |
|||
|
|||
static INT BuildSetManualControl( LPBYTE pBuffer, BYTE bAddress, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 18, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 18, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'G'; // control code (command) |
|||
|
|||
BYTE bCmd = 0; |
|||
if( pStatus->bPanRight ) bCmd |= 0x01; |
|||
if( pStatus->bPanOn ) bCmd |= 0x02; |
|||
if( pStatus->bTiltDown ) bCmd |= 0x04; |
|||
if( pStatus->bTiltOn ) bCmd |= 0x08; |
|||
if( pStatus->bZoomWide ) bCmd |= 0x10; |
|||
if( pStatus->bZoomOn ) bCmd |= 0x20; |
|||
|
|||
pBuffer[ 7] = ToAscii( bCmd, 1 ); // command |
|||
pBuffer[ 8] = ToAscii( bCmd, 0 ); // --||-- |
|||
pBuffer[ 9] = ToAscii( 0xB2, 1 ); // auto iris + fast zoom |
|||
pBuffer[10] = ToAscii( 0xB2, 0 ); // --||-- |
|||
|
|||
bCmd = 0x02; |
|||
if( pStatus->bLampsOn ) bCmd |= 0x18; |
|||
if( pStatus->bWiperOn ) bCmd |= 0x40; |
|||
|
|||
pBuffer[11] = ToAscii( bCmd, 1 ); // digital zoom |
|||
pBuffer[12] = ToAscii( bCmd, 0 ); // --||-- |
|||
pBuffer[13] = ToAscii( pStatus->bPanSpeed, 1 ); // pan speed |
|||
pBuffer[14] = ToAscii( pStatus->bPanSpeed, 0 ); // --||-- |
|||
pBuffer[15] = ToAscii( pStatus->bTiltSpeed, 1 ); // unused |
|||
pBuffer[16] = ToAscii( pStatus->bTiltSpeed, 0 ); // --||-- |
|||
return CheckSum( pBuffer, 18 ); |
|||
} |
|||
|
|||
static INT BuildSetManualControlPZ( LPBYTE pBuffer, BYTE bAddress, PCONTROL_STATUS pStatus, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
pBuffer[ 3] = ToAscii( 24, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 24, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'w'; // control code (command) |
|||
|
|||
BYTE bCmd = 0; |
|||
if( pStatus->bPanRight ) bCmd |= 0x01; |
|||
if( pStatus->bPanOn ) bCmd |= 0x02; |
|||
if( pStatus->bTiltDown ) bCmd |= 0x04; |
|||
if( pStatus->bTiltOn ) bCmd |= 0x08; |
|||
if( pStatus->bZoomWide ) bCmd |= 0x10; |
|||
if( pStatus->bZoomOn ) bCmd |= 0x20; |
|||
|
|||
pBuffer[ 7] = ToAscii( bCmd, 1 ); // command |
|||
pBuffer[ 8] = ToAscii( bCmd, 0 ); // --||-- |
|||
pBuffer[ 9] = ToAscii( 0x32, 1 ); // auto iris + fast zoom |
|||
pBuffer[10] = ToAscii( 0x32, 0 ); // --||-- |
|||
|
|||
bCmd = 0x02; |
|||
if( pStatus->bLampsOn ) bCmd |= 0x18; |
|||
if( pStatus->bWiperOn ) bCmd |= 0x40; |
|||
|
|||
pBuffer[11] = ToAscii( bCmd, 1 ); // digital zoom |
|||
pBuffer[12] = ToAscii( bCmd, 0 ); // --||-- |
|||
pBuffer[13] = ToAscii( pStatus->bPanSpeed, 1 ); // pan speed |
|||
pBuffer[14] = ToAscii( pStatus->bPanSpeed, 0 ); // --||-- |
|||
pBuffer[15] = ToAscii( pStatus->bTiltSpeed, 1 ); // unused |
|||
pBuffer[16] = ToAscii( pStatus->bTiltSpeed, 0 ); // --||-- |
|||
pBuffer[17] = ToAscii( wZoom, 2 ); // absolute zoom position |
|||
pBuffer[18] = ToAscii( wZoom, 1 ); // --||-- |
|||
pBuffer[19] = ToAscii( wZoom, 0 ); // --||-- |
|||
pBuffer[20] = ToAscii( 0x000, 2 ); // focus position (unsupported) |
|||
pBuffer[21] = ToAscii( 0x000, 1 ); // --||-- |
|||
pBuffer[22] = ToAscii( 0x000, 0 ); // --||-- |
|||
return CheckSum( pBuffer, 24 ); |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, BOOL bRight, BYTE bSpeed, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pStatus->bPanOn = bSpeed ? TRUE : FALSE; |
|||
pStatus->bPanRight = bRight; |
|||
pStatus->bPanSpeed = bSpeed; |
|||
return BuildSetManualControl( pBuffer, bAddress, pStatus ); |
|||
} |
|||
|
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, BOOL bUp, BYTE bSpeed, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pStatus->bTiltOn = bSpeed ? TRUE : FALSE; |
|||
pStatus->bTiltDown = !bUp; |
|||
pStatus->bTiltSpeed = bSpeed; |
|||
return BuildSetManualControl( pBuffer, bAddress, pStatus ); |
|||
} |
|||
|
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, BOOL bTele, BYTE bSpeed, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pStatus->bZoomOn = bSpeed ? TRUE : FALSE; |
|||
pStatus->bZoomWide = !bTele; |
|||
return BuildSetManualControl( pBuffer, bAddress, pStatus ); |
|||
} |
|||
|
|||
static INT BuildSetDefaultSettings( LPBYTE pBuffer, BYTE bAddress, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
memset( pStatus, 0, sizeof(CONTROL_STATUS) ); |
|||
return BuildSetManualControl( pBuffer, bAddress, pStatus ); |
|||
} |
|||
|
|||
static INT BuildVisca( LPBYTE pBuffer, BYTE bAddress, PBYTE pCommand, INT nCount ) |
|||
{ |
|||
pBuffer[ 0] = 0x0A; // line feed (header) |
|||
pBuffer[ 1] = ToAscii( bAddress, 1 ); // address |
|||
pBuffer[ 2] = ToAscii( bAddress, 0 ); // --||-- |
|||
nCount <<= 1; |
|||
pBuffer[ 3] = ToAscii( 8 + nCount, 1 ); // length |
|||
pBuffer[ 4] = ToAscii( 8 + nCount, 0 ); // --||-- |
|||
pBuffer[ 5] = CF_HALF_DUPLEX; // control flag |
|||
pBuffer[ 6] = 'r'; // control code (command) |
|||
for( INT i = 0; i < nCount; i += 2 ) |
|||
{ |
|||
pBuffer[ i + 7 ] = ToAscii( *pCommand , 1 ); |
|||
pBuffer[ i + 8 ] = ToAscii( *pCommand++, 0 ); |
|||
} |
|||
return CheckSum( pBuffer, 8 + nCount ); |
|||
} |
|||
|
|||
static INT BuildSetSlowShutter( LPBYTE pBuffer, BYTE bAddress, BOOL bAuto ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x5A, bAuto ? 0x02 : 0x03, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetBackLight( LPBYTE pBuffer, BYTE bAddress, BOOL bOn ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x33, bOn ? 0x02 : 0x03, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetLowLux( LPBYTE pBuffer, BYTE bAddress, BOOL bOn ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x01, bOn ? 0x02 : 0x03, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetIRled( LPBYTE pBuffer, BYTE bAddress, BOOL bOn ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x31, bOn ? 0x02 : 0x03, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
/* |
|||
static BYTE SonyChar( BYTE bAscii ) |
|||
{ |
|||
return bAscii - 'A'; |
|||
} |
|||
|
|||
static INT BuildSetTitleClear( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x74, 0x00, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetTitleLowLight( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x73, 0x01, SonyChar( 'L' ), SonyChar( 'O' ), SonyChar( 'W' ), |
|||
0x1B, SonyChar( 'L' ), SonyChar( 'I' ), |
|||
SonyChar( 'G' ), SonyChar( 'H' ), SonyChar( 'T' ), |
|||
0x1B, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetTitleNormalLight1( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x73, 0x01, SonyChar( 'N' ), SonyChar( 'O' ), SonyChar( 'R' ), |
|||
SonyChar( 'M' ), SonyChar( 'A' ), SonyChar( 'L' ), |
|||
0x1B, 0x1B, 0x1B, |
|||
0x1B, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
static INT BuildSetTitleNormalLight2( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
BYTE pCommand[] = { 0x81, 0x01, 0x04, 0x73, 0x02, SonyChar( 'L' ), SonyChar( 'I' ), SonyChar( 'G' ), |
|||
SonyChar( 'H' ), SonyChar( 'T' ), 0x1B, |
|||
0x1B, 0x1B, 0x1B, |
|||
0x1B, 0xFF }; |
|||
return BuildVisca( pBuffer, bAddress, pCommand, sizeof(pCommand) ); |
|||
} |
|||
|
|||
static INT BuildSetLowLight( LPBYTE pBuffer, BYTE bAddress, BOOL bLowLight, PCONTROL_STATUS pStatus ) |
|||
{ |
|||
pStatus->bLampsOn = bLowLight; |
|||
|
|||
if( bLowLight ) |
|||
{ |
|||
INT nCount = 0; |
|||
nCount += BuildSetSlowShutter( pBuffer + nCount, bAddress, TRUE ); |
|||
nCount += BuildSetBackLight( pBuffer + nCount, bAddress, TRUE ); |
|||
nCount += BuildSetLowLux( pBuffer + nCount, bAddress, TRUE ); |
|||
nCount += BuildSetIRled( pBuffer + nCount, bAddress, TRUE ); |
|||
// nCount += BuildSetTitleClear( pBuffer + nCount, bAddress ); |
|||
// nCount += BuildSetTitleLowLight( pBuffer + nCount, bAddress ); |
|||
return nCount; |
|||
} |
|||
|
|||
INT nCount = 0; |
|||
nCount += BuildSetSlowShutter( pBuffer + nCount, bAddress, FALSE ); |
|||
nCount += BuildSetBackLight( pBuffer + nCount, bAddress, FALSE ); |
|||
nCount += BuildSetLowLux( pBuffer + nCount, bAddress, FALSE ); |
|||
nCount += BuildSetIRled( pBuffer + nCount, bAddress, FALSE ); |
|||
// nCount += BuildSetTitleClear( pBuffer + nCount, bAddress ); |
|||
// nCount += BuildSetTitleNormalLight1( pBuffer + nCount, bAddress ); |
|||
// nCount += BuildSetTitleNormalLight2( pBuffer + nCount, bAddress ); |
|||
return nCount; |
|||
} |
|||
*/ |
|||
static INT BuildSetPictureEffect( LPBYTE pBuffer, BYTE bAddress, INT nEffect ) |
|||
{ |
|||
// picture effects |
|||
BYTE pCommand[][6] = |
|||
{ |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x00, 0xFF }, // no effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x01, 0xFF }, // pastel effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x02, 0xFF }, // negative effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x03, 0xFF }, // sepia effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x04, 0xFF }, // B/W effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x05, 0xFF }, // solarize effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x06, 0xFF }, // mosaic effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x07, 0xFF }, // slim effect |
|||
{ 0x81, 0x01, 0x04, 0x63, 0x08, 0xFF } // stretch effect |
|||
}; |
|||
return BuildVisca( pBuffer, bAddress, pCommand[nEffect], sizeof(pCommand[0]) ); |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan ) |
|||
{ |
|||
return (wPan - 0x001L) * 360L / ( 0x0FFFL - 0x001 ); |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle ) |
|||
{ |
|||
return (WORD)( Angle * ( 0xFFFL - 0x001L ) / 360L + 0x001L ); |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
// return ((double)wTilt - 0x484) * 360.0 / 0xFFF; |
|||
// NP return 360L - ( wTilt - MIC_TILT_DEAD_ZONE ) * 360L / 0xFFFL; |
|||
#ifdef __BORLANDC__ |
|||
return 360L - ( wTilt - 0x484L ) * 360L / 0xFFFL; |
|||
#else |
|||
return BASIS_SHIFT - ( wTilt * 360.0 / 4095.0 ); |
|||
#endif |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
// return (WORD)(dAngle * 0xFFF / 360.0 + 0x484); |
|||
// NP return (WORD)( (360L - dAngle) * 0xFFFL / 360L + MIC_TILT_DEAD_ZONE ); |
|||
return (WORD)( (( dAngle > BASIS_SHIFT )?(360.0+BASIS_SHIFT-dAngle):(BASIS_SHIFT-dAngle))*4095.0/360.0); |
|||
} |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (WORD)( dPercent * 0x0923L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom ) |
|||
{ |
|||
return ( wZoom * 100L ) / 0x0923L; |
|||
} |
|||
|
|||
// speed |
|||
static BYTE Percent2Speed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 255L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Speed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 255L; |
|||
} |
|||
|
|||
// helpers |
|||
public: |
|||
static BYTE ToAscii( WORD wValue, BYTE nDigit ) |
|||
{ |
|||
static BYTE pHexTable[] = "0123456789ABCDEF"; |
|||
return pHexTable[ ( wValue >> (nDigit << 2) ) & 0x0F ]; |
|||
} |
|||
static WORD ToValue( PBYTE pAscii, INT nCount ) |
|||
{ |
|||
WORD bValue = 0; |
|||
for( INT i = 0; i < nCount; i++ ) |
|||
{ |
|||
bValue <<= 4; |
|||
if( pAscii[i] >= '0' && pAscii[i] <= '9' ) bValue += (pAscii[i] - '0'); |
|||
else |
|||
if( pAscii[i] >= 'A' && pAscii[i] <= 'F' ) bValue += (pAscii[i] - 'A' + 10); |
|||
else |
|||
if( pAscii[i] >= 'a' && pAscii[i] <= 'f' ) bValue += (pAscii[i] - 'a' + 10); |
|||
} |
|||
return bValue; |
|||
} |
|||
|
|||
private: |
|||
static INT CheckSum( LPBYTE pBuffer, INT nLength ) |
|||
{ |
|||
INT nCount = nLength - 1; |
|||
PBYTE pCheckSum = pBuffer + nCount; |
|||
// XOR all bytes in packet |
|||
*pCheckSum = *pBuffer++; |
|||
while( --nCount ) |
|||
*pCheckSum ^= *pBuffer++; |
|||
// set top bit into '1' |
|||
*pCheckSum |= 0x80; |
|||
return nLength; |
|||
} |
|||
}; |
|||
|
|||
#endif |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
@ -0,0 +1,213 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: PMic1300.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of PMic1300.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Version.h"
|
|||
#include "..\LgLib\Comm\PMic1300.h"
|
|||
#include "..\LgLib\Comm\Mic1300m.h"
|
|||
#else
|
|||
#include "..\Version.h"
|
|||
#include "PMic1300.h"
|
|||
#include "Mic1300m.h"
|
|||
#endif
|
|||
|
|||
|
|||
CProtocolMic1300PTZ::CProtocolMic1300PTZ() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_pAddress[0] = m_pAddress[1] = '0'; |
|||
m_bReadAnyAddress = FALSE; |
|||
} |
|||
|
|||
CProtocolMic1300PTZ::~CProtocolMic1300PTZ() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolMic1300PTZ::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolMic1300PTZ::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
void CProtocolMic1300PTZ::SetAddress( BYTE bAddress ) |
|||
{ |
|||
m_pAddress[0] = PTZ_MIC_1_300::ToAscii( bAddress, 1 ); |
|||
m_pAddress[1] = PTZ_MIC_1_300::ToAscii( bAddress, 0 ); |
|||
} |
|||
|
|||
BOOL CProtocolMic1300PTZ::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
while( TRUE ) |
|||
{ |
|||
// assume without read repeating
|
|||
BOOL bRepeat = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
DWORD nReadCount = 0; |
|||
|
|||
// try to read command header
|
|||
if( m_nCount < HEADER_SIZE ) |
|||
{ |
|||
// read new data
|
|||
DWORD nCount = HEADER_SIZE - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= HEADER_SIZE ) |
|||
{ |
|||
// check header tag
|
|||
if( ( m_pBuffer[ HEADER_POS ] == HEADER_TAG ) ) |
|||
{ |
|||
if( m_bReadAnyAddress || |
|||
( m_pBuffer[ ADDRESS_POS ] == '0' && m_pBuffer[ ADDRESS_POS+1 ] == '0' ) || |
|||
( m_pBuffer[ ADDRESS_POS ] == m_pAddress[0] && m_pBuffer[ ADDRESS_POS+1 ] == m_pAddress[1] ) ) |
|||
{ |
|||
// validate possibility of lenght
|
|||
WORD bLength = PTZ_MIC_1_300::ToValue( m_pBuffer + LENGTH_POS, 2 ); |
|||
if( bLength <= MAX_COMMAND_SIZE ) |
|||
{ |
|||
nReadCount = bLength - m_nCount; |
|||
} |
|||
else |
|||
nReadCount = MAX_COMMAND_SIZE - m_nCount; |
|||
} |
|||
else |
|||
nReadCount = MAX_COMMAND_SIZE - m_nCount; |
|||
} |
|||
else |
|||
nReadCount = MAX_COMMAND_SIZE - m_nCount; |
|||
} |
|||
else |
|||
nReadCount = MAX_COMMAND_SIZE - m_nCount; |
|||
|
|||
// read new data
|
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nReadCount, dwTimeout ) ); |
|||
|
|||
// initialize pointer
|
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// parse input bytes
|
|||
while( m_nCount >= MIN_COMMAND_SIZE ) |
|||
{ |
|||
// check header tag
|
|||
if( ( m_pBuffer[ HEADER_POS ] == HEADER_TAG ) ) |
|||
{ |
|||
if( m_bReadAnyAddress || |
|||
( m_pBuffer[ ADDRESS_POS ] == '0' && m_pBuffer[ ADDRESS_POS+1 ] == '0' ) || |
|||
( m_pBuffer[ ADDRESS_POS ] == m_pAddress[0] && m_pBuffer[ ADDRESS_POS+1 ] == m_pAddress[1] ) ) |
|||
{ |
|||
// validate possibility of lenght
|
|||
WORD bLength = PTZ_MIC_1_300::ToValue( m_pBuffer + LENGTH_POS, 2 ); |
|||
if( bLength <= MAX_COMMAND_SIZE ) |
|||
{ |
|||
// check current lenght
|
|||
if( bLength > m_nCount ) |
|||
return FALSE; |
|||
|
|||
// length without checksum
|
|||
BYTE bSubLength = bLength - 1; |
|||
|
|||
// test checksum
|
|||
BYTE bCheckSum = m_pBufferPtr[0]; |
|||
INT i; |
|||
for( i = 1; i < bSubLength; i++ ) |
|||
bCheckSum ^= m_pBufferPtr[ i ]; |
|||
bCheckSum |= 0x80; |
|||
|
|||
// if checksum ok
|
|||
if( bCheckSum == m_pBufferPtr[ i ] ) |
|||
{ |
|||
BOOL bFromCamera = m_pBufferPtr[ CFLAG_POS ] != PTZ_MIC_1_300::CF_FULL_DUPLEX && |
|||
m_pBufferPtr[ CFLAG_POS ] != PTZ_MIC_1_300::CF_HALF_DUPLEX && |
|||
m_pBufferPtr[ CFLAG_POS ] != PTZ_MIC_1_300::CF_SIMPLEX; |
|||
|
|||
// if right direction
|
|||
if( bFromCamera ) |
|||
{ |
|||
// store length
|
|||
(*pCount) = (INT)bLength; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
} |
|||
else |
|||
{ |
|||
// probably received echo - repeat reading
|
|||
bRepeat = TRUE; |
|||
} |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += bSubLength; |
|||
m_nCount -= bSubLength; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr ++; |
|||
m_nCount --; |
|||
} |
|||
|
|||
// if not need to repeat reading
|
|||
if( !bRepeat ) |
|||
break; |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolMic1300PTZ::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length
|
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data
|
|||
DWORD dwDataSize = nCount; |
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: PMic1300.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CProtocolMic1300PTZ |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __PROTOCOL__MIC_1_300__PTZ__H__INCLUDED__ |
|||
#define __PROTOCOL__MIC_1_300__PTZ__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#endif |
|||
|
|||
|
|||
class CProtocolMic1300PTZ : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolMic1300PTZ(); |
|||
virtual ~CProtocolMic1300PTZ(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
|
|||
public: |
|||
void SetAddress( BYTE bAddress ); |
|||
void SetReadAnyAddress( BOOL bReadAnyAddress ) { m_bReadAnyAddress = bReadAnyAddress; } |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
enum { |
|||
HEADER_POS = 0U, // position of header byte |
|||
ADDRESS_POS = 1U, // position of address |
|||
LENGTH_POS = 3U, // position of data length |
|||
CFLAG_POS = 5U, // position of data length |
|||
HEADER_SIZE = 5U, // header + address(2) + length(2) |
|||
MIN_COMMAND_SIZE = 8U, // header + address(2) + length(2) + ctrlflag + ctrlcode + checksumm |
|||
MAX_DATA_LENGTH = 247U, // maximun data size |
|||
MAX_COMMAND_SIZE = (MAX_DATA_LENGTH + MIN_COMMAND_SIZE), // header + address(2) + length(2) + ctrlflag + ctrlcode + data(N) + checksumm |
|||
HEADER_TAG = 0x0AU, // header byte |
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_pAddress[2]; |
|||
|
|||
private: |
|||
BOOL m_bReadAnyAddress; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,55 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZNesher.cpp |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Source file of PTZNesher.cpp |
|||
//---------------------------------------------------------------------------- |
|||
#include "stdafx.h" |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\PNesher.h" |
|||
#else |
|||
#include "PNesher.h" |
|||
#endif |
|||
|
|||
CProtocolPTZNesher::CProtocolPTZNesher() |
|||
{ |
|||
printf("Protocol NESHER\n"); |
|||
m_pConnection = NULL; |
|||
} |
|||
|
|||
CProtocolPTZNesher::~CProtocolPTZNesher() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZNesher::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZNesher::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
} |
|||
|
|||
BOOL CProtocolPTZNesher::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
return FALSE; |
|||
} |
|||
|
|||
BOOL CProtocolPTZNesher::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
return FALSE; |
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: PTZNesher.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of PTZNesher.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Comm\PNesher.h"
|
|||
#else
|
|||
#include "PNesher.h"
|
|||
#endif
|
|||
|
|||
CProtocolPTZNesher::CProtocolPTZNesher() |
|||
{ |
|||
m_pConnection = NULL; |
|||
} |
|||
|
|||
CProtocolPTZNesher::~CProtocolPTZNesher() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZNesher::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZNesher::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
} |
|||
|
|||
BOOL CProtocolPTZNesher::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
return FALSE; |
|||
} |
|||
|
|||
BOOL CProtocolPTZNesher::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
return FALSE; |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZNesher.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZNesher.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__NESHER__H__INCLUDED__ |
|||
#define __PTZ__NESHER__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif // _MSC_VER > 1000 |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
|
|||
class CProtocolPTZNesher : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZNesher(); |
|||
virtual ~CProtocolPTZNesher(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
|
|||
public: |
|||
CConnection* GetConnection() { return m_pConnection; } |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,143 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: PTZPelco.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of PTZPelco.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Comm\PTZChina.h"
|
|||
#else
|
|||
#include "PTZChina.h"
|
|||
#endif
|
|||
|
|||
CProtocolPTZChina::CProtocolPTZChina(){ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_bAddress = 1; |
|||
#ifdef DEBUG_PELCO_PROTO
|
|||
logFID = NULL; |
|||
logFID = fopen( "pelco_china_bin.log", "w" ); |
|||
#endif
|
|||
} |
|||
|
|||
CProtocolPTZChina::~CProtocolPTZChina(){ |
|||
#ifdef DEBUG_PELCO_PROTO
|
|||
if( logFID ) fclose( logFID ); |
|||
#endif
|
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZChina::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZChina::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
void CProtocolPTZChina::SetAddress( BYTE bAddress ) |
|||
{ |
|||
m_bAddress = bAddress; |
|||
} |
|||
|
|||
BOOL CProtocolPTZChina::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ){ |
|||
|
|||
if( dwTimeout == 0UL ) { |
|||
*pCount = 0; |
|||
return TRUE; |
|||
}; |
|||
|
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// try to read command header
|
|||
if( m_nCount < m_nResponseSize ) |
|||
{ |
|||
// read new data
|
|||
DWORD nCount = m_nResponseSize - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= m_nResponseSize ){ |
|||
#ifdef DEBUG_PELCO_PROTO
|
|||
if( logFID ){ |
|||
// prepare data&time
|
|||
SYSTEMTIME st; |
|||
GetLocalTime( &st ); |
|||
// prepare full string
|
|||
fprintf( logFID, "[%02d/%02d/%02d %02d:%02d:%02d:%03d]", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds ); |
|||
// output
|
|||
fprintf( logFID, ">" ); |
|||
for( INT index=0; index < m_nResponseSize; index++ ) fprintf( logFID, "%02X", m_pBufferPtr[index]); |
|||
fprintf( logFID, "\r\n" ); |
|||
}; |
|||
#endif
|
|||
// store length
|
|||
(*pCount) = (INT)m_nResponseSize; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += m_nResponseSize; |
|||
m_nCount -= m_nResponseSize; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
} |
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolPTZChina::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length
|
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data
|
|||
DWORD dwDataSize = nCount; |
|||
#ifdef DEBUG_PELCO_PROTO
|
|||
if( logFID ){ |
|||
// prepare data&time
|
|||
SYSTEMTIME st; |
|||
GetLocalTime( &st ); |
|||
// prepare full string
|
|||
fprintf( logFID, "[%02d/%02d/%02d %02d:%02d:%02d:%03d]", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds ); |
|||
// output
|
|||
fprintf( logFID, "<" ); |
|||
for( INT index=0; index < nCount; index++ ) fprintf( logFID, "%02X", pBuffer[index]); |
|||
fprintf( logFID, "\r\n" ); |
|||
}; |
|||
#endif
|
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
|
|||
@ -0,0 +1,472 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZPelco.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZPelco.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__CHINA__D__H__INCLUDED__ |
|||
#define __PTZ__CHINA__D__H__INCLUDED__ |
|||
|
|||
|
|||
//#define DEBUG_PELCO_PROTO |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZChina : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZChina(); |
|||
virtual ~CProtocolPTZChina(); |
|||
|
|||
#ifdef DEBUG_PELCO_PROTO |
|||
FILE *logFID; |
|||
#endif |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection *m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_CHINA { |
|||
typedef enum E_MOVE_DIR{ |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE{ |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
|
|||
static INT CheckSum( LPBYTE pBuffer ){ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
static INT BuildClearPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x05; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x03; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGotoPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x07; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPan( LPBYTE pBuffer, BYTE bAddress, WORD wPan ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4B; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetTilt( LPBYTE pBuffer, BYTE bAddress, WORD wTilt ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4D; // data byte 4 |
|||
pBuffer[ 4] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4F; // data byte 4 |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetPan( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x51; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetTilt( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x53; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x55; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
|
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ) |
|||
{ |
|||
//BYTE bCommand1 = 0x88; |
|||
BYTE bCommand1 = 0x00; |
|||
BYTE bCommand2 = 0; |
|||
switch( PtzState.ePanDir & PAN_MASK ){ |
|||
case PAN_LEFT: bCommand2 |= 0x04; break; |
|||
case PAN_RIGHT: bCommand2 |= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ){ |
|||
case TILT_UP: bCommand2 |= 0x08; break; |
|||
case TILT_DOWN: bCommand2 |= 0x10; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
switch( PtzState.eIrisDir & IRIS_MASK ){ |
|||
case IRIS_OPEN: bCommand1 |= 0x02; break; |
|||
case IRIS_CLOSE: bCommand1 |= 0x04; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ){ |
|||
case FOCUS_FAR: bCommand2 |= 0x80; break; |
|||
case FOCUS_NEAR: bCommand1 |= 0x01; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ){ |
|||
case ZOOM_TELE: bCommand2 |= 0x20; break; |
|||
case ZOOM_WIDE: bCommand2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = bCommand1; // data byte 3 |
|||
pBuffer[ 3] = bCommand2; // data byte 4 |
|||
|
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2B; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoIris( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2D; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoGainControl( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2F; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildBacklightCompensation( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x31; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildWhiteBalance( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x33; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ) |
|||
{ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return 360 - wPan * 360L / 35999L; |
|||
} else { |
|||
return wPan * 360L / 35999L; |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ) |
|||
{ |
|||
// PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return (WORD)( (360 - Angle) * 35999L / 360L ); |
|||
} else { |
|||
return (WORD)( Angle * 35999L / 360L ); |
|||
} |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
return wTilt * 360L / 35999L; |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (WORD)( dAngle * 35999L / 360L ); |
|||
} |
|||
|
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
/* enum |
|||
{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
}; |
|||
*/ |
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , WORD MaxZoom ) |
|||
{ |
|||
long ZMIN = 0L; |
|||
long ZMAX = (long) MaxZoom; |
|||
long ZLIM = ZMAX - ZMIN; |
|||
long PERC = ( ZLIM * ( LONG ) dPercent )/ 100L; |
|||
/*WORD AA = ( (WORD) ( ((float)dPercent) * PERC ) ) & 0xFFFF;*/ |
|||
//return (WORD)( 655L * ( LONG ) dPercent ); |
|||
return (WORD) PERC; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, WORD MaxZoom ) |
|||
{ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = (float) 0.0; |
|||
float ZMAX = (float) MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
int AA = (int)(((ZLIM - (float)(wZoom)) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0x11L; |
|||
} |
|||
|
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0xFEL; |
|||
} |
|||
|
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
if ( dPercent<30 && dPercent > 0 ) dPercent = 30; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x3F / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 0x3F; |
|||
} |
|||
|
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
|
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
|
|||
} PTZ_CHINA; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,140 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: PTZFlir.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of PTZFlir.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Comm\PTZFlir.h"
|
|||
#else
|
|||
#include "PTZFlir.h"
|
|||
#endif
|
|||
|
|||
CProtocolPTZFlir::CProtocolPTZFlir() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_bAddress = 1; |
|||
#ifdef DEBUG_FLIR_PROTO
|
|||
logFID = NULL; |
|||
logFID = fopen( "flir_bin.log", "w" ); |
|||
#endif
|
|||
} |
|||
|
|||
CProtocolPTZFlir::~CProtocolPTZFlir() |
|||
{ |
|||
#ifdef DEBUG_FLIR_PROTO
|
|||
if( logFID ) fclose( logFID ); |
|||
#endif
|
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZFlir::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
void CProtocolPTZFlir::SetAddress( BYTE bAddress ) |
|||
{ |
|||
m_bAddress = bAddress; |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// try to read command header
|
|||
if( m_nCount < m_nResponseSize ) |
|||
{ |
|||
// read new data
|
|||
DWORD nCount = m_nResponseSize - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= m_nResponseSize ){ |
|||
#ifdef DEBUG_FLIR_PROTO
|
|||
if( logFID ){ |
|||
// prepare data&time
|
|||
SYSTEMTIME st; |
|||
GetLocalTime( &st ); |
|||
// prepare full string
|
|||
fprintf( logFID, "[%02d/%02d/%02d %02d:%02d:%02d:%03d]", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds ); |
|||
// output
|
|||
fprintf( logFID, ">" ); |
|||
for( INT index=0; index < m_nResponseSize; index++ ) fprintf( logFID, "%02X", m_pBufferPtr[index]); |
|||
fprintf( logFID, "\r\n" ); |
|||
}; |
|||
#endif
|
|||
// store length
|
|||
(*pCount) = (INT)m_nResponseSize; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += m_nResponseSize; |
|||
m_nCount -= m_nResponseSize; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length
|
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data
|
|||
DWORD dwDataSize = nCount; |
|||
#ifdef DEBUG_FLIR_PROTO
|
|||
if( logFID ){ |
|||
// prepare data&time
|
|||
SYSTEMTIME st; |
|||
GetLocalTime( &st ); |
|||
// prepare full string
|
|||
fprintf( logFID, "[%02d/%02d/%02d %02d:%02d:%02d:%03d]", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds ); |
|||
// output
|
|||
fprintf( logFID, "<" ); |
|||
for( INT index=0; index < nCount; index++ ) fprintf( logFID, "%02X", pBuffer[index]); |
|||
fprintf( logFID, "\r\n" ); |
|||
}; |
|||
#endif
|
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
@ -0,0 +1,108 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZFlir.cpp |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Source file of PTZFlir.cpp |
|||
//---------------------------------------------------------------------------- |
|||
#include "stdafx.h" |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\PTZFlir.h" |
|||
#else |
|||
#include "PTZFlir.h" |
|||
#endif |
|||
|
|||
CProtocolPTZFlir::CProtocolPTZFlir() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_bAddress = 1; |
|||
} |
|||
|
|||
CProtocolPTZFlir::~CProtocolPTZFlir() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZFlir::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
void CProtocolPTZFlir::SetAddress( BYTE bAddress ) |
|||
{ |
|||
m_bAddress = bAddress; |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part |
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// try to read command header |
|||
if( m_nCount < m_nResponseSize ) |
|||
{ |
|||
// read new data |
|||
DWORD nCount = m_nResponseSize - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= m_nResponseSize ) |
|||
{ |
|||
// store length |
|||
(*pCount) = (INT)m_nResponseSize; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// shift pointers |
|||
m_pBufferPtr += m_nResponseSize; |
|||
m_nCount -= m_nResponseSize; |
|||
|
|||
// at least one command received |
|||
bResult = TRUE; |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length |
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data |
|||
DWORD dwDataSize = nCount; |
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
@ -0,0 +1,461 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZFlir.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZFlir.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__FLIR__D__H__INCLUDED__ |
|||
#define __PTZ__FLIR__D__H__INCLUDED__ |
|||
|
|||
//#define DEBUG_FLIR_PROTO |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZFlir : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZFlir(); |
|||
virtual ~CProtocolPTZFlir(); |
|||
#ifdef DEBUG_FLIR_PROTO |
|||
FILE *logFID; |
|||
#endif |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
INT GetResponseSize() { return m_nResponseSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS_ww_ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_FLIR |
|||
{ |
|||
typedef enum E_MOVE_DIR |
|||
{ |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE |
|||
{ |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
|
|||
static INT CheckSum( LPBYTE pBuffer ) |
|||
{ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
|
|||
static INT BuildSetPan( LPBYTE pBuffer, BYTE bAddress, WORD wPan ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4B; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetTilt( LPBYTE pBuffer, BYTE bAddress, WORD wTilt ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4D; // data byte 4 |
|||
pBuffer[ 4] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4F; // data byte 4 |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetPan( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x51; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetTilt( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x53; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x55; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
|
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ) |
|||
{ |
|||
//BYTE bCommand1 = 0x88; |
|||
BYTE bCommand1 = 0x00; |
|||
BYTE bCommand2 = 0; |
|||
switch( PtzState.ePanDir & PAN_MASK ) |
|||
{ |
|||
case PAN_LEFT: bCommand2 |= 0x04; break; |
|||
case PAN_RIGHT: bCommand2 |= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ) |
|||
{ |
|||
case TILT_UP: bCommand2 |= 0x08; break; |
|||
case TILT_DOWN: bCommand2 |= 0x10; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
|
|||
switch( PtzState.eIrisDir & IRIS_MASK ) |
|||
{ |
|||
case IRIS_OPEN: bCommand1 |= 0x02; break; |
|||
case IRIS_CLOSE: bCommand1 |= 0x04; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ) |
|||
{ |
|||
case FOCUS_FAR: bCommand2 |= 0x80; break; |
|||
case FOCUS_NEAR: bCommand1 |= 0x01; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ) |
|||
{ |
|||
case ZOOM_TELE: bCommand2 |= 0x20; break; |
|||
case ZOOM_WIDE: bCommand2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
|
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = bCommand1; // data byte 3 |
|||
pBuffer[ 3] = bCommand2; // data byte 4 |
|||
|
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2B; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoIris( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2D; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoGainControl( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2F; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildBacklightCompensation( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x31; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildWhiteBalance( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x33; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ) |
|||
{ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return 360 - wPan * 360L / 35999L; |
|||
} else { |
|||
return wPan * 360L / 35999L; |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ) |
|||
{ |
|||
// PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return (WORD)( (360 - Angle) * 35999L / 360L ); |
|||
} else { |
|||
return (WORD)( Angle * 35999L / 360L ); |
|||
} |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
return wTilt * 360L / 35999L; |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (WORD)( dAngle * 35999L / 360L ); |
|||
} |
|||
|
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
/* enum |
|||
{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
};*/ |
|||
|
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , WORD MaxZoom ) |
|||
{ |
|||
WORD ZMIN = 0; |
|||
WORD ZMAX = MaxZoom; |
|||
WORD ZLIM = ZMAX - ZMIN; |
|||
|
|||
if ( dPercent<5 ) dPercent=5; |
|||
if ( dPercent>80 ) dPercent=80; |
|||
|
|||
float PERC = (float)( ZLIM / 100.0f ); |
|||
WORD AA = ((WORD)(dPercent * PERC)) & 0xFFFF; |
|||
return AA; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, WORD MaxZoom ) |
|||
{ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = (float) 0.0; |
|||
float ZMAX = (float) MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
int AA = (int)((((float)(wZoom) - ZLIM ) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0x11L; |
|||
} |
|||
|
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0xFEL; |
|||
} |
|||
|
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
if ( dPercent<30 && dPercent > 4 ) dPercent = 30; |
|||
if ( dPercent>50 ) dPercent = 50; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x3F / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 0x3F; |
|||
} |
|||
|
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
|
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
|
|||
}PTZ_FLIR; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,456 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZFlir.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZFlir.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__FLIR__D__H__INCLUDED__ |
|||
#define __PTZ__FLIR__D__H__INCLUDED__ |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZFlir : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZFlir(); |
|||
virtual ~CProtocolPTZFlir(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
INT GetResponseSize() { return m_nResponseSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS_ww_ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_FLIR |
|||
{ |
|||
typedef enum E_MOVE_DIR |
|||
{ |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE |
|||
{ |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
|
|||
static INT CheckSum( LPBYTE pBuffer ) |
|||
{ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
|
|||
static INT BuildSetPan( LPBYTE pBuffer, BYTE bAddress, WORD wPan ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4B; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetTilt( LPBYTE pBuffer, BYTE bAddress, WORD wTilt ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4D; // data byte 4 |
|||
pBuffer[ 4] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4F; // data byte 4 |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetPan( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x51; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetTilt( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x53; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x55; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
|
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ) |
|||
{ |
|||
//BYTE bCommand1 = 0x88; |
|||
BYTE bCommand1 = 0x00; |
|||
BYTE bCommand2 = 0; |
|||
switch( PtzState.ePanDir & PAN_MASK ) |
|||
{ |
|||
case PAN_LEFT: bCommand2 |= 0x04; break; |
|||
case PAN_RIGHT: bCommand2 |= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ) |
|||
{ |
|||
case TILT_UP: bCommand2 |= 0x08; break; |
|||
case TILT_DOWN: bCommand2 |= 0x10; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
|
|||
switch( PtzState.eIrisDir & IRIS_MASK ) |
|||
{ |
|||
case IRIS_OPEN: bCommand1 |= 0x02; break; |
|||
case IRIS_CLOSE: bCommand1 |= 0x04; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ) |
|||
{ |
|||
case FOCUS_FAR: bCommand2 |= 0x80; break; |
|||
case FOCUS_NEAR: bCommand1 |= 0x01; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ) |
|||
{ |
|||
case ZOOM_TELE: bCommand2 |= 0x20; break; |
|||
case ZOOM_WIDE: bCommand2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
|
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = bCommand1; // data byte 3 |
|||
pBuffer[ 3] = bCommand2; // data byte 4 |
|||
|
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2B; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoIris( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2D; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoGainControl( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2F; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildBacklightCompensation( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x31; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildWhiteBalance( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x33; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ) |
|||
{ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return 360 - wPan * 360L / 35999L; |
|||
} else { |
|||
return wPan * 360L / 35999L; |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ) |
|||
{ |
|||
// PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return (WORD)( (360 - Angle) * 35999L / 360L ); |
|||
} else { |
|||
return (WORD)( Angle * 35999L / 360L ); |
|||
} |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
return wTilt * 360L / 35999L; |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (WORD)( dAngle * 35999L / 360L ); |
|||
} |
|||
|
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
/* enum |
|||
{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
};*/ |
|||
|
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , int MaxZoom ) |
|||
{ |
|||
int ZMIN = 0; |
|||
int ZMAX = MaxZoom; |
|||
int ZLIM = ZMAX - ZMIN; |
|||
|
|||
if ( dPercent<5 ) dPercent=5; |
|||
if ( dPercent>80 ) dPercent=80; |
|||
|
|||
WORD PERC = ZLIM / 100; |
|||
WORD AA = (dPercent * PERC) & 0xFFFF; |
|||
return AA; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, int MaxZoom ) |
|||
{ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = 0; |
|||
float ZMAX = MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
int AA = (int)((((float)(wZoom) - ZLIM ) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0x11L; |
|||
} |
|||
|
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0xFEL; |
|||
} |
|||
|
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
if ( dPercent<30 && dPercent > 4 ) dPercent = 30; |
|||
if ( dPercent>50 ) dPercent = 50; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x3F / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 0x3F; |
|||
} |
|||
|
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
|
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
|
|||
}PTZ_FLIR; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,108 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: PTZFlir.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of PTZFlir.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Comm\PTZFlir.h"
|
|||
#else
|
|||
#include "PTZFlir.h"
|
|||
#endif
|
|||
|
|||
CProtocolPTZFlir::CProtocolPTZFlir() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_bAddress = 1; |
|||
} |
|||
|
|||
CProtocolPTZFlir::~CProtocolPTZFlir() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZFlir::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
void CProtocolPTZFlir::SetAddress( BYTE bAddress ) |
|||
{ |
|||
m_bAddress = bAddress; |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// try to read command header
|
|||
if( m_nCount < m_nResponseSize ) |
|||
{ |
|||
// read new data
|
|||
DWORD nCount = m_nResponseSize - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= m_nResponseSize ) |
|||
{ |
|||
// store length
|
|||
(*pCount) = (INT)m_nResponseSize; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += m_nResponseSize; |
|||
m_nCount -= m_nResponseSize; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolPTZFlir::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length
|
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data
|
|||
DWORD dwDataSize = nCount; |
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
@ -0,0 +1,538 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZFlir.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZFlir.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__FLIR__D__H__INCLUDED__ |
|||
#define __PTZ__FLIR__D__H__INCLUDED__ |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZFlir : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZFlir(); |
|||
virtual ~CProtocolPTZFlir(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_FLIR |
|||
{ |
|||
typedef enum E_MOVE_DIR |
|||
{ |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE |
|||
{ |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
|
|||
static INT CheckSum( LPBYTE pBuffer ) |
|||
{ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
|
|||
static INT BuildSetPT( LPBYTE pBuffer, BYTE bAddress, WORD wPan, WORD wTilt ) |
|||
{ |
|||
pBuffer[ 0] = 0x80 | bAddress; |
|||
pBuffer[ 1] = 0x01; |
|||
pBuffer[ 2] = 0x06; |
|||
pBuffer[ 3] = 0x02; |
|||
pBuffer[ 4] = 0x18; //max P speed |
|||
pBuffer[ 5] = 0x18; //max T speed |
|||
|
|||
pBuffer[ 6] = ( wPan >> 12 ) & 0x0F; |
|||
pBuffer[ 7] = ( wPan >> 8 ) & 0x0F; |
|||
pBuffer[ 8] = ( wPan >> 4 ) & 0x0F; |
|||
pBuffer[ 9]= ( wPan >> 0 ) & 0x0F; |
|||
|
|||
pBuffer[ 10]= ( wTilt >> 12 ) & 0x0F; |
|||
pBuffer[ 11]= ( wTilt >> 8 ) & 0x0F; |
|||
pBuffer[ 12]= ( wTilt >> 4 ) & 0x0F; |
|||
pBuffer[ 13]= ( wTilt >> 0 ) & 0x0F; |
|||
|
|||
pBuffer[ 14]= 0xFF; |
|||
return 15; |
|||
} |
|||
|
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; |
|||
pBuffer[ 1] = bAddress; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0x4F; |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildGetPT( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x80 | bAddress; |
|||
pBuffer[ 1] = 0x09; |
|||
pBuffer[ 2] = 0x06; |
|||
pBuffer[ 3] = 0x12; |
|||
pBuffer[ 4] = 0xFF; |
|||
return 5; |
|||
} |
|||
|
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x80 | bAddress; |
|||
pBuffer[ 1] = 0x09; |
|||
pBuffer[ 2] = 0x04; |
|||
pBuffer[ 3] = 0x47; |
|||
pBuffer[ 4] = 0xFF; |
|||
return 5; |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
|
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
BYTE bCommand1 = 0x00; |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ) |
|||
{ |
|||
case ZOOM_TELE: bCommand1 = 0x26; break; // 2x 6 - 80% speed ( 2 - 7) |
|||
case ZOOM_WIDE: bCommand1 = 0x35; break; |
|||
case ZOOM_STOP: bCommand1 = 0x00; break; |
|||
} |
|||
pBuffer[ 0] = 0x80 | bAddress; |
|||
pBuffer[ 1] = 0x01; |
|||
pBuffer[ 2] = 0x04; |
|||
pBuffer[ 3] = 0x07; |
|||
pBuffer[ 4] = bCommand1; |
|||
pBuffer[ 5] = 0xFF; |
|||
return 6; |
|||
} |
|||
|
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ) |
|||
{ |
|||
BYTE bCommand1 = 0x03; |
|||
BYTE bCommand2 = 0x03; |
|||
switch( PtzState.ePanDir & PAN_MASK ) |
|||
{ |
|||
case PAN_LEFT: bCommand1 &= 0x01; break; |
|||
case PAN_RIGHT: bCommand1 &= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ) |
|||
{ |
|||
case TILT_UP: bCommand2 &= 0x01; break; |
|||
case TILT_DOWN: bCommand2 &= 0x02; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
pBuffer[ 0] = 0x80 | bAddress; |
|||
pBuffer[ 1] = 0x01; |
|||
pBuffer[ 2] = 0x06; |
|||
pBuffer[ 3] = 0x01; |
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
pBuffer[ 6] = bCommand1; |
|||
pBuffer[ 7] = bCommand2; |
|||
pBuffer[ 8] = 0xFF; |
|||
return 9; |
|||
} |
|||
|
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0x80 | bAddress; |
|||
pBuffer[ 1] = 0x01; |
|||
pBuffer[ 2] = 0x04; |
|||
pBuffer[ 3] = 0x38; |
|||
pBuffer[ 4] = 0x02 | bValue ; |
|||
pBuffer[ 5] = 0xFF; |
|||
return 6; |
|||
} |
|||
|
|||
static INT Build_IR_AutoFCC( LPBYTE pBuffer) |
|||
{ |
|||
pBuffer[ 0] = 0x6E; |
|||
pBuffer[ 1] = 0x00; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0x0B; |
|||
pBuffer[ 4] = 0x00; |
|||
pBuffer[ 5] = 0x02; |
|||
pBuffer[ 6] = 0x0F; |
|||
pBuffer[ 7] = 0x08; |
|||
pBuffer[ 8] = 0x00; |
|||
pBuffer[ 9] = 0x00; |
|||
pBuffer[10] = 0x00; |
|||
pBuffer[11] = 0x00; |
|||
return 12; |
|||
} |
|||
|
|||
static INT Build_IR_AutoGainControl( LPBYTE pBuffer) |
|||
{ |
|||
pBuffer[ 0] = 0x6E; |
|||
pBuffer[ 1] = 0x00; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0x13; |
|||
pBuffer[ 4] = 0x00; |
|||
pBuffer[ 5] = 0x02; |
|||
pBuffer[ 6] = 0xE5; |
|||
pBuffer[ 7] = 0xCA; |
|||
pBuffer[ 8] = 0x00; |
|||
pBuffer[ 9] = 0x06; |
|||
pBuffer[10] = 0x60; |
|||
pBuffer[11] = 0xC6; |
|||
return 12; |
|||
} |
|||
|
|||
static INT Build_IR_WhiteHot( LPBYTE pBuffer) |
|||
{ |
|||
pBuffer[ 0] = 0x6E; |
|||
pBuffer[ 1] = 0x00; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0x10; |
|||
pBuffer[ 4] = 0x00; |
|||
pBuffer[ 5] = 0x02; |
|||
pBuffer[ 6] = 0xBC; |
|||
pBuffer[ 7] = 0x9A; |
|||
pBuffer[ 8] = 0x00; |
|||
pBuffer[ 9] = 0x00; |
|||
pBuffer[10] = 0x00; |
|||
pBuffer[11] = 0x00; |
|||
return 12; |
|||
} |
|||
|
|||
static INT Build_IR_E_Zoom( LPBYTE pBuffer) |
|||
{ |
|||
pBuffer[ 0] = 0x6E; |
|||
pBuffer[ 1] = 0x00; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0x0F; |
|||
pBuffer[ 4] = 0x00; |
|||
pBuffer[ 5] = 0x02; |
|||
pBuffer[ 6] = 0xD3; |
|||
pBuffer[ 7] = 0xC8; |
|||
pBuffer[ 8] = 0x00; |
|||
pBuffer[ 9] = 0x00; |
|||
pBuffer[10] = 0x00; |
|||
pBuffer[11] = 0x00; |
|||
return 12; |
|||
} |
|||
static INT Build_IR_ROI( LPBYTE pBuffer) |
|||
{ |
|||
pBuffer[ 0] = 0x6E; |
|||
pBuffer[ 1] = 0x00; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0x4C; |
|||
pBuffer[ 4] = 0x00; |
|||
pBuffer[ 5] = 0x08; |
|||
pBuffer[ 6] = 0x36; |
|||
pBuffer[ 7] = 0x7F; |
|||
pBuffer[ 8] = 0xFF; |
|||
pBuffer[ 9] = 0xB0; |
|||
pBuffer[10] = 0xFF; |
|||
pBuffer[11] = 0xE2; |
|||
pBuffer[12] = 0x00; |
|||
pBuffer[13] = 0x50; |
|||
pBuffer[14] = 0x00; |
|||
pBuffer[15] = 0x1E; |
|||
pBuffer[16] = 0xE0; |
|||
pBuffer[17] = 0x3A; |
|||
return 18; |
|||
} |
|||
static INT Build_IR_Detales( LPBYTE pBuffer) |
|||
{ |
|||
pBuffer[ 0] = 0x6E; |
|||
pBuffer[ 1] = 0x00; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0xD3; |
|||
pBuffer[ 4] = 0x00; |
|||
pBuffer[ 5] = 0x08; |
|||
pBuffer[ 6] = 0x62; |
|||
pBuffer[ 7] = 0x77; |
|||
pBuffer[ 8] = 0x00; |
|||
pBuffer[ 9] = 0x00; |
|||
pBuffer[10] = 0x30; |
|||
pBuffer[11] = 0x90; |
|||
pBuffer[12] = 0x20; |
|||
pBuffer[13] = 0x64; |
|||
pBuffer[14] = 0x00; |
|||
pBuffer[15] = 0x04; |
|||
pBuffer[16] = 0x15; |
|||
pBuffer[17] = 0x8E; |
|||
return 18; |
|||
} |
|||
static INT Build_IR_ShutterOpen( LPBYTE pBuffer) |
|||
{ |
|||
pBuffer[ 0] = 0x6E; |
|||
pBuffer[ 1] = 0x00; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0x79; |
|||
pBuffer[ 4] = 0x00; |
|||
pBuffer[ 5] = 0x02; |
|||
pBuffer[ 6] = 0xB9; |
|||
pBuffer[ 7] = 0x60; |
|||
pBuffer[ 8] = 0x00; |
|||
pBuffer[ 9] = 0x00; |
|||
pBuffer[10] = 0x00; |
|||
pBuffer[11] = 0x00; |
|||
return 12; |
|||
} |
|||
static INT Build_IR_Reset( LPBYTE pBuffer) |
|||
{ |
|||
pBuffer[ 0] = 0x6E; |
|||
pBuffer[ 1] = 0x00; |
|||
pBuffer[ 2] = 0x00; |
|||
pBuffer[ 3] = 0x03; |
|||
pBuffer[ 4] = 0x00; |
|||
pBuffer[ 5] = 0x00; |
|||
pBuffer[ 6] = 0x86; |
|||
pBuffer[ 7] = 0xEB; |
|||
pBuffer[ 8] = 0x00; |
|||
pBuffer[ 9] = 0x00; |
|||
return 10; |
|||
} |
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ) |
|||
{ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return 360 - (wPan / 16 ); |
|||
} else { |
|||
return wPan / 16; |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ) |
|||
{ |
|||
// PPR=1; |
|||
|
|||
if ( PPR == 0 ){ |
|||
Angle = (360 - Angle); |
|||
}; |
|||
|
|||
if ( Angle <= 180 ){ |
|||
return (WORD) ((225+Angle)*16); |
|||
}; |
|||
if ( Angle > 180 ){ |
|||
return (WORD) (((Angle-180)+45)*16); |
|||
}; |
|||
|
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
return wTilt / 16 ; |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (WORD)( (93-dAngle) * 16 ); |
|||
} |
|||
|
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
/* enum |
|||
{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
};*/ |
|||
|
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , WORD MaxZoom ) |
|||
{ |
|||
WORD ZMIN = 0; |
|||
WORD ZMAX = MaxZoom; |
|||
WORD ZLIM = ZMAX - ZMIN; |
|||
float PERC = ZLIM / 100.00; |
|||
WORD AA = ((WORD)(dPercent * PERC)) & 0xFFFF; |
|||
return AA; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, WORD MaxZoom ) |
|||
{ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = 0; |
|||
float ZMAX = MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
//int AA = (int)((((float)(wZoom) - ZLIM ) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
int AA = (int)(((float)(wZoom/16)/360 ) * 100.00 ); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0x11L; |
|||
} |
|||
|
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0xFEL; |
|||
} |
|||
|
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
if ( dPercent<30 && dPercent > 0 ) dPercent = 30; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x40 / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 0x40; |
|||
} |
|||
|
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
|
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2, BYTE b3, BYTE b4 ) |
|||
{ |
|||
return (((WORD)b1) << 12) | (((WORD)b2) << 8 ) | (((WORD)b3) << 4 ) | ((WORD)b4); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2, BYTE b3, BYTE b4 ) |
|||
{ |
|||
return (((WORD)b1) << 12) | (((WORD)b2) << 8 ) | (((WORD)b3) << 4 ) | ((WORD)b4); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2, BYTE b3, BYTE b4 ) |
|||
{ |
|||
return (((WORD)b1) << 12) | (((WORD)b2) << 8 ) | (((WORD)b3) << 4 ) | ((WORD)b4); |
|||
} |
|||
|
|||
}PTZ_FLIR; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,140 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: PTZPelco.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of PTZPelco.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Comm\PTZPelco.h"
|
|||
#else
|
|||
#include "PTZPelco.h"
|
|||
#endif
|
|||
|
|||
CProtocolPTZPelco::CProtocolPTZPelco() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_bAddress = 1; |
|||
#ifdef DEBUG_PELCO_PROTO
|
|||
logFID = NULL; |
|||
logFID = fopen( "pelco_bin.log", "w" ); |
|||
#endif
|
|||
} |
|||
|
|||
CProtocolPTZPelco::~CProtocolPTZPelco() |
|||
{ |
|||
#ifdef DEBUG_PELCO_PROTO
|
|||
if( logFID ) fclose( logFID ); |
|||
#endif
|
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZPelco::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZPelco::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
void CProtocolPTZPelco::SetAddress( BYTE bAddress ) |
|||
{ |
|||
m_bAddress = bAddress; |
|||
} |
|||
|
|||
BOOL CProtocolPTZPelco::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// try to read command header
|
|||
if( m_nCount < m_nResponseSize ) |
|||
{ |
|||
// read new data
|
|||
DWORD nCount = m_nResponseSize - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= m_nResponseSize ){ |
|||
#ifdef DEBUG_PELCO_PROTO
|
|||
if( logFID ){ |
|||
// prepare data&time
|
|||
SYSTEMTIME st; |
|||
GetLocalTime( &st ); |
|||
// prepare full string
|
|||
fprintf( logFID, "[%02d/%02d/%02d %02d:%02d:%02d:%03d]", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds ); |
|||
// output
|
|||
fprintf( logFID, ">" ); |
|||
for( INT index=0; index < m_nResponseSize; index++ ) fprintf( logFID, "%02X", m_pBufferPtr[index]); |
|||
fprintf( logFID, "\r\n" ); |
|||
}; |
|||
#endif
|
|||
// store length
|
|||
(*pCount) = (INT)m_nResponseSize; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += m_nResponseSize; |
|||
m_nCount -= m_nResponseSize; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
} |
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolPTZPelco::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length
|
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data
|
|||
DWORD dwDataSize = nCount; |
|||
#ifdef DEBUG_PELCO_PROTO
|
|||
if( logFID ){ |
|||
// prepare data&time
|
|||
SYSTEMTIME st; |
|||
GetLocalTime( &st ); |
|||
// prepare full string
|
|||
fprintf( logFID, "[%02d/%02d/%02d %02d:%02d:%02d:%03d]", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds ); |
|||
// output
|
|||
fprintf( logFID, "<" ); |
|||
for( INT index=0; index < nCount; index++ ) fprintf( logFID, "%02X", pBuffer[index]); |
|||
fprintf( logFID, "\r\n" ); |
|||
}; |
|||
#endif
|
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
|
|||
@ -0,0 +1,484 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZPelco.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZPelco.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__PELCO__D__H__INCLUDED__ |
|||
#define __PTZ__PELCO__D__H__INCLUDED__ |
|||
|
|||
|
|||
//#define DEBUG_PELCO_PROTO |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZPelco : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZPelco(); |
|||
virtual ~CProtocolPTZPelco(); |
|||
|
|||
#ifdef DEBUG_PELCO_PROTO |
|||
FILE *logFID; |
|||
#endif |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_PELCO |
|||
{ |
|||
typedef enum E_MOVE_DIR |
|||
{ |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE |
|||
{ |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
|
|||
static INT CheckSum( LPBYTE pBuffer ) |
|||
{ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
static INT BuildClearPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x05; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x03; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGotoPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x07; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPan( LPBYTE pBuffer, BYTE bAddress, WORD wPan ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4B; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetTilt( LPBYTE pBuffer, BYTE bAddress, WORD wTilt ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4D; // data byte 4 |
|||
pBuffer[ 4] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4F; // data byte 4 |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetPan( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x51; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetTilt( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x53; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x55; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
|
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ) |
|||
{ |
|||
//BYTE bCommand1 = 0x88; |
|||
BYTE bCommand1 = 0x00; |
|||
BYTE bCommand2 = 0; |
|||
switch( PtzState.ePanDir & PAN_MASK ) |
|||
{ |
|||
case PAN_LEFT: bCommand2 |= 0x04; break; |
|||
case PAN_RIGHT: bCommand2 |= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ) |
|||
{ |
|||
case TILT_UP: bCommand2 |= 0x08; break; |
|||
case TILT_DOWN: bCommand2 |= 0x10; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
|
|||
switch( PtzState.eIrisDir & IRIS_MASK ) |
|||
{ |
|||
case IRIS_OPEN: bCommand1 |= 0x02; break; |
|||
case IRIS_CLOSE: bCommand1 |= 0x04; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ) |
|||
{ |
|||
case FOCUS_FAR: bCommand2 |= 0x80; break; |
|||
case FOCUS_NEAR: bCommand1 |= 0x01; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ) |
|||
{ |
|||
case ZOOM_TELE: bCommand2 |= 0x20; break; |
|||
case ZOOM_WIDE: bCommand2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
|
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = bCommand1; // data byte 3 |
|||
pBuffer[ 3] = bCommand2; // data byte 4 |
|||
|
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2B; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoIris( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2D; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoGainControl( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2F; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildBacklightCompensation( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x31; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildWhiteBalance( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x33; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ) |
|||
{ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return 360 - wPan * 360L / 35999L; |
|||
} else { |
|||
return wPan * 360L / 35999L; |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ) |
|||
{ |
|||
// PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return (WORD)( (360 - Angle) * 35999L / 360L ); |
|||
} else { |
|||
return (WORD)( Angle * 35999L / 360L ); |
|||
} |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
return wTilt * 360L / 35999L; |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (WORD)( dAngle * 35999L / 360L ); |
|||
} |
|||
|
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
/* enum |
|||
{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
};*/ |
|||
|
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , WORD MaxZoom ) |
|||
{ |
|||
long ZMIN = 0L; |
|||
long ZMAX = (long) MaxZoom; |
|||
long ZLIM = ZMAX - ZMIN; |
|||
long PERC = ( ZLIM * ( LONG ) dPercent )/ 100L; |
|||
/*WORD AA = ( (WORD) ( ((float)dPercent) * PERC ) ) & 0xFFFF;*/ |
|||
//return (WORD)( 655L * ( LONG ) dPercent ); |
|||
return (WORD) PERC; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, WORD MaxZoom ) |
|||
{ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = (float) 0.0; |
|||
float ZMAX = (float) MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
int AA = (int)(((ZLIM - (float)(wZoom)) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0x11L; |
|||
} |
|||
|
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0xFEL; |
|||
} |
|||
|
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
if ( dPercent<30 && dPercent > 0 ) dPercent = 30; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x3F / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 0x3F; |
|||
} |
|||
|
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
|
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
|
|||
}PTZ_PELCO; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,508 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZPelco.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZPelco.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__PELCO__D__H__INCLUDED__ |
|||
#define __PTZ__PELCO__D__H__INCLUDED__ |
|||
|
|||
|
|||
//#define DEBUG_PELCO_PROTO |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZPelco : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZPelco(); |
|||
virtual ~CProtocolPTZPelco(); |
|||
|
|||
#ifdef DEBUG_PELCO_PROTO |
|||
FILE *logFID; |
|||
#endif |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection *m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_PELCO |
|||
{ |
|||
typedef enum E_MOVE_DIR |
|||
{ |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE |
|||
{ |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
|
|||
static INT CheckSum( LPBYTE pBuffer ) |
|||
{ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
static INT CheckSumE( LPBYTE pBuffer, BYTE cnt ) |
|||
{ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < cnt; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[cnt] = nChecksum; |
|||
return (cnt+1); |
|||
} |
|||
static INT BuildClearPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x05; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x03; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGotoPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x07; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPan( LPBYTE pBuffer, BYTE bAddress, WORD wPan ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4B; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetTilt( LPBYTE pBuffer, BYTE bAddress, WORD wTilt ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4D; // data byte 4 |
|||
pBuffer[ 4] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4F; // data byte 4 |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildSetPTZ( LPBYTE pBuffer, BYTE bAddress, WORD wPan, WORD wTilt, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x91; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
pBuffer[ 6] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 7] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
pBuffer[ 8] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 9] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSumE( pBuffer, 10 ); // data byte 9 |
|||
|
|||
} |
|||
|
|||
static INT BuildGetPan( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x51; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetTilt( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x53; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x55; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
|
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ) |
|||
{ |
|||
//BYTE bCommand1 = 0x88; |
|||
BYTE bCommand1 = 0x00; |
|||
BYTE bCommand2 = 0; |
|||
switch( PtzState.ePanDir & PAN_MASK ) |
|||
{ |
|||
case PAN_LEFT: bCommand2 |= 0x04; break; |
|||
case PAN_RIGHT: bCommand2 |= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ) |
|||
{ |
|||
case TILT_UP: bCommand2 |= 0x08; break; |
|||
case TILT_DOWN: bCommand2 |= 0x10; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
|
|||
switch( PtzState.eIrisDir & IRIS_MASK ) |
|||
{ |
|||
case IRIS_OPEN: bCommand1 |= 0x02; break; |
|||
case IRIS_CLOSE: bCommand1 |= 0x04; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ) |
|||
{ |
|||
case FOCUS_FAR: bCommand2 |= 0x80; break; |
|||
case FOCUS_NEAR: bCommand1 |= 0x01; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ) |
|||
{ |
|||
case ZOOM_TELE: bCommand2 |= 0x20; break; |
|||
case ZOOM_WIDE: bCommand2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
|
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = bCommand1; // data byte 3 |
|||
pBuffer[ 3] = bCommand2; // data byte 4 |
|||
|
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2B; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoIris( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2D; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildAutoGainControl( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2F; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildBacklightCompensation( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x31; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
static INT BuildWhiteBalance( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ) |
|||
{ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x33; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ) |
|||
{ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return 360 - wPan * 360L / 35999L; |
|||
} else { |
|||
return wPan * 360L / 35999L; |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ) |
|||
{ |
|||
// PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return (WORD)( (360 - Angle) * 35999L / 360L ); |
|||
} else { |
|||
return (WORD)( Angle * 35999L / 360L ); |
|||
} |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ) |
|||
{ |
|||
return wTilt * 360L / 35999L; |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (WORD)( dAngle * 35999L / 360L ); |
|||
} |
|||
|
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
/* enum |
|||
{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
};*/ |
|||
|
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , WORD MaxZoom ) |
|||
{ |
|||
long ZMIN = 0L; |
|||
long ZMAX = (long) MaxZoom; |
|||
long ZLIM = ZMAX - ZMIN; |
|||
long PERC = ( ZLIM * ( LONG ) dPercent )/ 100L; |
|||
/*WORD AA = ( (WORD) ( ((float)dPercent) * PERC ) ) & 0xFFFF;*/ |
|||
//return (WORD)( 655L * ( LONG ) dPercent ); |
|||
return (WORD) PERC; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, WORD MaxZoom ) |
|||
{ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = (float) 0.0; |
|||
float ZMAX = (float) MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
int AA = (int)(((ZLIM - (float)(wZoom)) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0x11L; |
|||
} |
|||
|
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0xFEL; |
|||
} |
|||
|
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
if ( dPercent<30 && dPercent > 0 ) dPercent = 30; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x3F / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return bSpeed * 100L / 0x3F; |
|||
} |
|||
|
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ) |
|||
{ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
|
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
|
|||
}PTZ_PELCO; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,404 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZPelco.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZPelco.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__SERAPHIM__D__H__INCLUDED__ |
|||
#define __PTZ__SERAPHIM__D__H__INCLUDED__ |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZSeraphim : public CProtocol{ |
|||
public: |
|||
CProtocolPTZSeraphim(); |
|||
virtual ~CProtocolPTZSeraphim(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_SERAPHIM { |
|||
typedef enum E_MOVE_DIR { |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE { |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
static INT CheckSum( LPBYTE pBuffer ){ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
static INT BuildClearPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x05; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x03; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGotoPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x07; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPan( LPBYTE pBuffer, BYTE bAddress, WORD wPan ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4B; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetTilt( LPBYTE pBuffer, BYTE bAddress, WORD wTilt ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4D; // data byte 4 |
|||
pBuffer[ 4] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4F; // data byte 4 |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGetPan( LPBYTE pBuffer, BYTE bAddress ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x51; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGetTilt( LPBYTE pBuffer, BYTE bAddress ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x53; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x55; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ){ |
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ){ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ){ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ){ |
|||
//BYTE bCommand1 = 0x88; |
|||
BYTE bCommand1 = 0x00; |
|||
BYTE bCommand2 = 0; |
|||
switch( PtzState.ePanDir & PAN_MASK ){ |
|||
case PAN_LEFT: bCommand2 |= 0x04; break; |
|||
case PAN_RIGHT: bCommand2 |= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ){ |
|||
case TILT_UP: bCommand2 |= 0x08; break; |
|||
case TILT_DOWN: bCommand2 |= 0x10; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
switch( PtzState.eIrisDir & IRIS_MASK ){ |
|||
case IRIS_OPEN: bCommand1 |= 0x02; break; |
|||
case IRIS_CLOSE: bCommand1 |= 0x04; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ){ |
|||
case FOCUS_FAR: bCommand2 |= 0x80; break; |
|||
case FOCUS_NEAR: bCommand1 |= 0x01; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ){ |
|||
case ZOOM_TELE: bCommand2 |= 0x20; break; |
|||
case ZOOM_WIDE: bCommand2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = bCommand1; // data byte 3 |
|||
pBuffer[ 3] = bCommand2; // data byte 4 |
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2B; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildAutoIris( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2D; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildAutoGainControl( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2F; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildBacklightCompensation( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x31; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildWhiteBalance( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x33; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ){ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return ( CLgDevicePTZ::PTZ_DEGREE ) ( 360 - wPan * 360L / 35999L ); |
|||
} else { |
|||
return ( CLgDevicePTZ::PTZ_DEGREE ) ( wPan * 360L / 35999L ); |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ){ |
|||
// PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return (WORD)( (360 - Angle) * 35999L / 360L ); |
|||
} else { |
|||
return (WORD)( Angle * 35999L / 360L ); |
|||
} |
|||
} |
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ){ |
|||
return ( CLgDevicePTZ::PTZ_DEGREE )( wTilt * 360L / 35999L ); |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ){ |
|||
return (WORD)( dAngle * 35999L / 360L ); |
|||
} |
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
enum{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
}; |
|||
#ifndef ZOOM_LIMIT_MAX |
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
#endif |
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , int MaxZoom ){ |
|||
int ZMIN = 0; |
|||
int ZMAX = MaxZoom; |
|||
int ZLIM = ZMAX - ZMIN; |
|||
WORD PERC = ZLIM / 100; |
|||
WORD AA = (dPercent * PERC) & 0xFFFF; |
|||
return AA; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, int MaxZoom ){ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = 0; |
|||
float ZMAX = MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
int AA = (int)((((float)(wZoom) - ZLIM ) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ){ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ){ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ){ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ){ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ){ |
|||
return ( CLgDevicePTZ::PTZ_PERCENT )( bIris * 100L / 0x11L ); |
|||
} |
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ){ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ){ |
|||
return ( CLgDevicePTZ::PTZ_PERCENT )( bIris * 100L / 0xFEL ); |
|||
} |
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ){ |
|||
if ( dPercent<30 && dPercent > 0 ) dPercent = 30; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x3F / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ){ |
|||
return ( CLgDevicePTZ::PTZ_PERCENT )( bSpeed * 100L / 0x3F ); |
|||
} |
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ){ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ){ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ){ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ){ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ){ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
} PTZ_SERAPHIM; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,108 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: PTZPelco.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of PTZPelco.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Comm\PTZSrph.h"
|
|||
#else
|
|||
#include "PTZSrph.h"
|
|||
#endif
|
|||
|
|||
CProtocolPTZSeraphim::CProtocolPTZSeraphim() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_bAddress = 1; |
|||
} |
|||
|
|||
CProtocolPTZSeraphim::~CProtocolPTZSeraphim() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZSeraphim::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZSeraphim::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
void CProtocolPTZSeraphim::SetAddress( BYTE bAddress ) |
|||
{ |
|||
m_bAddress = bAddress; |
|||
} |
|||
|
|||
BOOL CProtocolPTZSeraphim::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// try to read command header
|
|||
if( m_nCount < m_nResponseSize ) |
|||
{ |
|||
// read new data
|
|||
DWORD nCount = m_nResponseSize - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= m_nResponseSize ) |
|||
{ |
|||
// store length
|
|||
(*pCount) = (INT)m_nResponseSize; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += m_nResponseSize; |
|||
m_nCount -= m_nResponseSize; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolPTZSeraphim::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length
|
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data
|
|||
DWORD dwDataSize = nCount; |
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
@ -0,0 +1,404 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZPelco.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZPelco.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__SERAPHIM__D__H__INCLUDED__ |
|||
#define __PTZ__SERAPHIM__D__H__INCLUDED__ |
|||
|
|||
#pragma once |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
class CProtocolPTZSeraphim : public CProtocol{ |
|||
public: |
|||
CProtocolPTZSeraphim(); |
|||
virtual ~CProtocolPTZSeraphim(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
MAX_COMMAND_SIZE = 128, |
|||
SYNCH_BYTE = 0xFF, |
|||
|
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_SERAPHIM { |
|||
typedef enum E_MOVE_DIR { |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE { |
|||
BYTE bPanSpeed; |
|||
BYTE bTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
static INT CheckSum( LPBYTE pBuffer ){ |
|||
BYTE nChecksum = 0; |
|||
for( INT i = 1; i < 6; i++ ) |
|||
nChecksum += pBuffer[i]; |
|||
pBuffer[6] = nChecksum; |
|||
return 7; |
|||
} |
|||
static INT BuildClearPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x05; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x03; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGotoPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPresetID ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x07; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = ( bPresetID ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetPan( LPBYTE pBuffer, BYTE bAddress, WORD wPan ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4B; // data byte 4 |
|||
pBuffer[ 4] = ( wPan >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetTilt( LPBYTE pBuffer, BYTE bAddress, WORD wTilt ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4D; // data byte 4 |
|||
pBuffer[ 4] = ( wTilt >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wTilt >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildSetZoom( LPBYTE pBuffer, BYTE bAddress, WORD wZoom ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x4F; // data byte 4 |
|||
pBuffer[ 4] = ( wZoom >> 8 ) & 0xFF; // data byte 5 |
|||
pBuffer[ 5] = ( wZoom >> 0 ) & 0xFF; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGetPan( LPBYTE pBuffer, BYTE bAddress ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x51; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGetTilt( LPBYTE pBuffer, BYTE bAddress ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x53; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildGetZoom( LPBYTE pBuffer, BYTE bAddress ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x55; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = 0x00; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, BYTE bSpeed, PTZ_STATE& PtzState ){ |
|||
PtzState.bPanSpeed = bSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, BYTE bSpeed, PTZ_STATE& PtzState ){ |
|||
PtzState.bTiltSpeed = bSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ){ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ){ |
|||
//BYTE bCommand1 = 0x88; |
|||
BYTE bCommand1 = 0x00; |
|||
BYTE bCommand2 = 0; |
|||
switch( PtzState.ePanDir & PAN_MASK ){ |
|||
case PAN_LEFT: bCommand2 |= 0x04; break; |
|||
case PAN_RIGHT: bCommand2 |= 0x02; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ){ |
|||
case TILT_UP: bCommand2 |= 0x08; break; |
|||
case TILT_DOWN: bCommand2 |= 0x10; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
switch( PtzState.eIrisDir & IRIS_MASK ){ |
|||
case IRIS_OPEN: bCommand1 |= 0x02; break; |
|||
case IRIS_CLOSE: bCommand1 |= 0x04; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ){ |
|||
case FOCUS_FAR: bCommand2 |= 0x80; break; |
|||
case FOCUS_NEAR: bCommand1 |= 0x01; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ){ |
|||
case ZOOM_TELE: bCommand2 |= 0x20; break; |
|||
case ZOOM_WIDE: bCommand2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = bCommand1; // data byte 3 |
|||
pBuffer[ 3] = bCommand2; // data byte 4 |
|||
pBuffer[ 4] = PtzState.bPanSpeed; |
|||
pBuffer[ 5] = PtzState.bTiltSpeed; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
static INT BuildAutoFocus( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2B; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildAutoIris( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2D; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildAutoGainControl( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x2F; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildBacklightCompensation( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x31; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
static INT BuildWhiteBalance( LPBYTE pBuffer, BYTE bAddress, BYTE bValue ){ |
|||
pBuffer[ 0] = 0xFF; // data byte 1 |
|||
pBuffer[ 1] = bAddress; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x33; // data byte 4 |
|||
pBuffer[ 4] = 0x00; // data byte 5 |
|||
pBuffer[ 5] = bValue; // data byte 6 |
|||
return CheckSum( pBuffer ); // data byte 9 |
|||
} |
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan , int PPR ){ |
|||
//PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return ( CLgDevicePTZ::PTZ_DEGREE ) ( 360 - wPan * 360L / 35999L ); |
|||
} else { |
|||
return ( CLgDevicePTZ::PTZ_DEGREE ) ( wPan * 360L / 35999L ); |
|||
}; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle, int PPR ){ |
|||
// PPR=1; |
|||
if ( PPR == 0 ){ |
|||
return (WORD)( (360 - Angle) * 35999L / 360L ); |
|||
} else { |
|||
return (WORD)( Angle * 35999L / 360L ); |
|||
} |
|||
} |
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( WORD wTilt ){ |
|||
return ( CLgDevicePTZ::PTZ_DEGREE )( wTilt * 360L / 35999L ); |
|||
} |
|||
static WORD Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ){ |
|||
return (WORD)( dAngle * 35999L / 360L ); |
|||
} |
|||
// enum { ZOOM_LIMIT_MAX = 0xFFFFL }; |
|||
// enum { ZOOM_LIMIT_MIN = 0x0000L }; |
|||
/* enum{ |
|||
ZOOM_LIMIT_MAX = 0x2C85L, //11397 |
|||
ZOOM_LIMIT_MIN = 0x0164L, //356 |
|||
|
|||
//ZOOM_LIMIT_MAX = 0xFFFFL, |
|||
//ZOOM_LIMIT_MIN = 0x0000L, |
|||
|
|||
ZOOM_LIMIT = ZOOM_LIMIT_MAX - ZOOM_LIMIT_MIN // 11041 |
|||
}; */ |
|||
#ifndef ZOOM_LIMIT_MAX |
|||
#define ZOOM_LIMIT_MAX 0x2C85L |
|||
#define ZOOM_LIMIT_MIN 0x0164L |
|||
#endif |
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent , int MaxZoom ){ |
|||
int ZMIN = 0; |
|||
int ZMAX = MaxZoom; |
|||
int ZLIM = ZMAX - ZMIN; |
|||
WORD PERC = ZLIM / 100; |
|||
WORD AA = (dPercent * PERC) & 0xFFFF; |
|||
return AA; |
|||
//return 0x0010; |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom, int MaxZoom ){ |
|||
//float ZMIN = 0x0164L; |
|||
//float ZMAX = 0x2C85L; |
|||
float ZMIN = 0; |
|||
float ZMAX = MaxZoom; |
|||
float ZLIM = ZMAX - ZMIN; |
|||
int AA = (int)((((float)(wZoom) - ZLIM ) * 100.00 ) / ( ZMAX - ZMIN )); |
|||
return (CLgDevicePTZ::PTZ_PERCENT) AA; |
|||
} |
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ){ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ){ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ){ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ){ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ){ |
|||
return ( CLgDevicePTZ::PTZ_PERCENT )( bIris * 100L / 0x11L ); |
|||
} |
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ){ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ){ |
|||
return ( CLgDevicePTZ::PTZ_PERCENT )( bIris * 100L / 0xFEL ); |
|||
} |
|||
// pan speed |
|||
static BYTE Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ){ |
|||
if ( dPercent<30 && dPercent > 0 ) dPercent = 30; |
|||
//return (BYTE) 0x30; |
|||
return (BYTE)( dPercent * 0x3F / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( BYTE bSpeed ){ |
|||
return ( CLgDevicePTZ::PTZ_PERCENT )( bSpeed * 100L / 0x3F ); |
|||
} |
|||
// tilt speed |
|||
static BYTE Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ){ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( BYTE bSpeed ){ |
|||
return PanSpeed2Percent( bSpeed ); |
|||
} |
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ){ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Tilt2Value( BYTE b1, BYTE b2 ){ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
static WORD Zoom2Value( BYTE b1, BYTE b2 ){ |
|||
return (((WORD)b1) << 8) | ((WORD)b2); |
|||
} |
|||
} PTZ_SERAPHIM; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,108 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: PTZVicon.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of PTZVicon.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Comm\PTZVicon.h"
|
|||
#else
|
|||
#include "PTZVicon.h"
|
|||
#endif
|
|||
|
|||
CProtocolPTZVicon::CProtocolPTZVicon() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_bAddress = 1; |
|||
} |
|||
|
|||
CProtocolPTZVicon::~CProtocolPTZVicon() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolPTZVicon::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolPTZVicon::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
void CProtocolPTZVicon::SetAddress( BYTE bAddress ) |
|||
{ |
|||
m_bAddress = bAddress; |
|||
} |
|||
|
|||
BOOL CProtocolPTZVicon::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// try to read command header
|
|||
if( m_nCount < m_nResponseSize ) |
|||
{ |
|||
// read new data
|
|||
DWORD nCount = m_nResponseSize - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= m_nResponseSize ) |
|||
{ |
|||
// store length
|
|||
(*pCount) = (INT)m_nResponseSize; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += m_nResponseSize; |
|||
m_nCount -= m_nResponseSize; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolPTZVicon::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length
|
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data
|
|||
DWORD dwDataSize = nCount; |
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
@ -0,0 +1,323 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: PTZVicon.h |
|||
// AUTHOR: Sergey Chizhevskiy |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZVicon.h |
|||
//---------------------------------------------------------------------------- |
|||
#ifndef __PTZ__VICON__H__INCLUDED__ |
|||
#define __PTZ__VICON__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif // _MSC_VER > 1000 |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
|
|||
class CProtocolPTZVicon : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolPTZVicon(); |
|||
virtual ~CProtocolPTZVicon(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
void SetAddress( BYTE bAddress ); |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
void SetResponseSize( INT nSize ) { m_nResponseSize = nSize; } |
|||
|
|||
public: |
|||
enum { MAX_COMMAND_SIZE = 20 }; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
INT m_nResponseSize; |
|||
}; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
typedef struct PTZ_VICON |
|||
{ |
|||
typedef enum E_MOVE_DIR |
|||
{ |
|||
PAN_RIGHT = 0x0001, PAN_LEFT = 0x0003, PAN_STOP = 0, PAN_MASK = 0x0003, |
|||
TILT_UP = 0x000C, TILT_DOWN = 0x0004, TILT_STOP = 0, TILT_MASK = 0x000C, |
|||
ZOOM_TELE = 0x0010, ZOOM_WIDE = 0x0030, ZOOM_STOP = 0, ZOOM_MASK = 0x0030, |
|||
IRIS_OPEN = 0x00C0, IRIS_CLOSE = 0x0040, IRIS_STOP = 0, IRIS_MASK = 0x00C0, |
|||
FOCUS_FAR = 0x0100, FOCUS_NEAR = 0x0300, FOCUS_STOP = 0, FOCUS_MASK = 0x0300, |
|||
}E_MOVE_DIR; |
|||
typedef struct PTZ_STATE |
|||
{ |
|||
WORD wPanSpeed; |
|||
WORD wTiltSpeed; |
|||
|
|||
E_MOVE_DIR ePanDir; |
|||
E_MOVE_DIR eTiltDir; |
|||
E_MOVE_DIR eZoomDir; |
|||
E_MOVE_DIR eIrisDir; |
|||
E_MOVE_DIR eFocusDir; |
|||
}PTZ_STATE, *PPTZ_STATE; |
|||
|
|||
static INT BuildHeader( LPBYTE pBuffer, BYTE bAddress, BOOL bExtended ) |
|||
{ |
|||
pBuffer[0] = 0x80 | ( bAddress >> 4 ); // header byte 1 |
|||
pBuffer[1] = bAddress & 0x0F; // header byte 2 |
|||
if( bExtended ) |
|||
pBuffer[1] |= 0x50; |
|||
return 2; |
|||
} |
|||
|
|||
static INT BuildModifyResponse( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0x00; // data byte 1 |
|||
pBuffer[ 1] = 0x00; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x00; // data byte 4 |
|||
pBuffer[ 4] = 0x13; // data byte 5 |
|||
pBuffer[ 5] = 0x04; // data byte 6 |
|||
pBuffer[ 6] = 0x00; // data byte 7 |
|||
pBuffer[ 7] = 0x00; // data byte 8 |
|||
return 8; |
|||
} |
|||
|
|||
static INT BuildGetPosition( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
// pBuffer[ 0] = 0x80 | ( bAddress >> 4 ); // header byte 1 |
|||
// pBuffer[ 1] = 0x00 | ( bAddress & 0xF ); // header byte 2 |
|||
return 0; |
|||
} |
|||
|
|||
static INT BuildGotoPosition( LPBYTE pBuffer, WORD bAddress, WORD wPan, BYTE bTilt, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = 0x00; // data byte 1 |
|||
pBuffer[ 1] = 0x00; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x00; // data byte 4 |
|||
pBuffer[ 4] = 0x17; // data byte 5 |
|||
pBuffer[ 5] = ( wPan >> 3 ) & 0x7F; // data byte 6 |
|||
pBuffer[ 6] = ( ( wPan & 0x07 ) << 4 ) | ( ( bTilt >> 4 ) & 0x0F ); // data byte 7 |
|||
pBuffer[ 7] = ( ( bTilt & 0x0F ) << 3 ) | ( ( wZoom >> 7 ) & 0x03 ); // data byte 8 |
|||
pBuffer[ 8] = wZoom & 0x7F; // data byte 9 |
|||
return 9; |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR ePanDir, WORD wSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.wPanSpeed = wSpeed; |
|||
PtzState.ePanDir = ePanDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eTiltDir, WORD wSpeed, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.wTiltSpeed = wSpeed; |
|||
PtzState.eTiltDir = eTiltDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, E_MOVE_DIR eZoomDir, PTZ_STATE& PtzState ) |
|||
{ |
|||
PtzState.eZoomDir = eZoomDir; |
|||
return BuildMove( pBuffer, bAddress, PtzState ); |
|||
} |
|||
|
|||
static INT BuildMove( LPBYTE pBuffer, BYTE bAddress, PTZ_STATE& PtzState ) |
|||
{ |
|||
BYTE bData1 = 0x02; |
|||
switch( PtzState.ePanDir & PAN_MASK ) |
|||
{ |
|||
case PAN_LEFT: bData1 |= 0x40; break; |
|||
case PAN_RIGHT: bData1 |= 0x20; break; |
|||
case PAN_STOP: break; |
|||
} |
|||
switch( PtzState.eTiltDir & TILT_MASK ) |
|||
{ |
|||
case TILT_UP: bData1 |= 0x10; break; |
|||
case TILT_DOWN: bData1 |= 0x08; break; |
|||
case TILT_STOP: break; |
|||
} |
|||
|
|||
BYTE bData2 = 0x01; |
|||
switch( PtzState.eIrisDir & IRIS_MASK ) |
|||
{ |
|||
case IRIS_OPEN: bData2 = 0x04; break; |
|||
case IRIS_CLOSE: bData2 = 0x02; break; |
|||
case IRIS_STOP: break; |
|||
} |
|||
switch( PtzState.eFocusDir & FOCUS_MASK ) |
|||
{ |
|||
case FOCUS_FAR: bData2 |= 0x10; break; |
|||
case FOCUS_NEAR: bData2 = 0x08; break; |
|||
case FOCUS_STOP: break; |
|||
} |
|||
switch( PtzState.eZoomDir & ZOOM_MASK ) |
|||
{ |
|||
case ZOOM_TELE: bData2 |= 0x20; break; |
|||
case ZOOM_WIDE: bData2 |= 0x40; break; |
|||
case ZOOM_STOP: break; |
|||
} |
|||
|
|||
pBuffer[ 0] = bData1; // data byte 1 |
|||
pBuffer[ 1] = bData2; // data byte 2 |
|||
pBuffer[ 2] = 0x00; // data byte 3 |
|||
pBuffer[ 3] = 0x00; // data byte 4 |
|||
|
|||
pBuffer[ 4] = ( PtzState.wPanSpeed >> 7 ) & 0x0F; // data byte 5 |
|||
pBuffer[ 5] = ( PtzState.wPanSpeed ) & 0x7F; // data byte 6 |
|||
pBuffer[ 6] = ( PtzState.wTiltSpeed >> 7 ) & 0x0F; // data byte 7 |
|||
pBuffer[ 7] = ( PtzState.wTiltSpeed ) & 0x7F; // data byte 8 |
|||
|
|||
return 8; |
|||
} |
|||
|
|||
// conversion |
|||
public: |
|||
// pan |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( WORD wPan ) |
|||
{ |
|||
return wPan * 360L / 720L; |
|||
} |
|||
static WORD Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle ) |
|||
{ |
|||
return (WORD)( Angle * 720L / 360L ); |
|||
} |
|||
|
|||
// tilt |
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree( BYTE wTilt ) |
|||
{ |
|||
return 90L - ( wTilt * 95L / 190L ); |
|||
} |
|||
static BYTE Degree2Tilt( CLgDevicePTZ::PTZ_DEGREE dAngle ) |
|||
{ |
|||
return (BYTE)( ( 90L - dAngle ) * 190L / 95L ); |
|||
} |
|||
|
|||
// zoom |
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (WORD)( dPercent * 176L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD wZoom ) |
|||
{ |
|||
return wZoom * 100L / 176L; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
while( pan < 0 ) pan += 360; |
|||
while( pan >= 360 ) pan -= 360; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
// restrict tilt within one period |
|||
while( tilt < 0 ) tilt += 360; |
|||
while( tilt >= 360 ) tilt -= 360; |
|||
|
|||
if( tilt > 90 && tilt < (360-5) ) |
|||
tilt = ( (tilt-90) < ((360-5)-tilt) ) ? 90 : -5; |
|||
else |
|||
return TRUE; |
|||
|
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// iris |
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0x11L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0x11L; |
|||
} |
|||
|
|||
// focus |
|||
static BYTE Percent2Focus( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (BYTE)( dPercent * 0xFEL / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT Focus2Percent( BYTE bIris ) |
|||
{ |
|||
return bIris * 100L / 0xFEL; |
|||
} |
|||
|
|||
// pan speed |
|||
static WORD Percent2PanSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return (WORD)( dPercent * 1023L / 100L ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT PanSpeed2Percent( WORD wSpeed ) |
|||
{ |
|||
return wSpeed * 100L / 1023L; |
|||
} |
|||
|
|||
// tilt speed |
|||
static WORD Percent2TiltSpeed( CLgDevicePTZ::PTZ_PERCENT dPercent ) |
|||
{ |
|||
return Percent2PanSpeed( dPercent ); |
|||
} |
|||
static CLgDevicePTZ::PTZ_PERCENT TiltSpeed2Percent( WORD wSpeed ) |
|||
{ |
|||
return PanSpeed2Percent( wSpeed ); |
|||
} |
|||
|
|||
// values conversion |
|||
static WORD Pan2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return ((((((WORD)b1) & 0x7F) << 3) | ( ((WORD)b2) >> 4) & 0x07 )); |
|||
} |
|||
static BYTE Tilt2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return ( ( b1 & 0x0F ) << 4 ) | ( ( b2 >> 3 ) & 0x0F ); |
|||
} |
|||
static BYTE Zoom2Value( BYTE b1, BYTE b2 ) |
|||
{ |
|||
return (((WORD)b1 & 0x03) << 7) | ( b2 & 0x07F ); |
|||
} |
|||
|
|||
}PTZ_VICON; |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
#endif |
|||
@ -0,0 +1,336 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: PTZm.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of PTZ_MIGVAN |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn -inl |
|||
#endif |
|||
|
|||
#ifndef __MIGVAN__PTZ__H__INCLUDED__ |
|||
#define __MIGVAN__PTZ__H__INCLUDED__ |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Device\LgDevPTZ.h" |
|||
#else |
|||
#include "..\Device\LgDevPTZ.h" |
|||
#endif |
|||
|
|||
struct PTZ_MIGVAN |
|||
{ |
|||
private: |
|||
static INT CheckSum( LPBYTE pBuffer ) |
|||
{ |
|||
BYTE size = pBuffer[1] + 2; |
|||
pBuffer[size] = 0; |
|||
for (int i = 0; i < size; i++ ) |
|||
pBuffer[size] += pBuffer[i]; |
|||
return (INT)(size + 1); |
|||
} |
|||
|
|||
public: |
|||
static INT BuildInquarePosition( LPBYTE pBuffer, BYTE bAddress ) |
|||
{ |
|||
pBuffer[0] = bAddress; // address |
|||
pBuffer[1] = 2; // length |
|||
pBuffer[2] = 4; // type |
|||
pBuffer[3] = 8; // command |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildSetAddress( LPBYTE pBuffer, PBYTE pSerialNumber, BYTE bAddress ) |
|||
{ |
|||
pBuffer[ 0] = 0; // address |
|||
pBuffer[ 1] = 9; // length |
|||
pBuffer[ 2] = 16; // type |
|||
pBuffer[ 3] = 4; // command |
|||
pBuffer[ 4] = pSerialNumber[0]; // dome serial number |
|||
pBuffer[ 5] = pSerialNumber[1]; // -||- |
|||
pBuffer[ 6] = pSerialNumber[2]; // -||- |
|||
pBuffer[ 7] = pSerialNumber[3]; // -||- |
|||
pBuffer[ 8] = pSerialNumber[4]; // -||- |
|||
pBuffer[ 9] = bAddress; // new dome address |
|||
pBuffer[10] = 4; // dome type |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildGetAddress( LPBYTE pBuffer ) |
|||
{ |
|||
pBuffer[ 0] = 0; // address |
|||
pBuffer[ 1] = 2; // length |
|||
pBuffer[ 2] = 16; // type |
|||
pBuffer[ 3] = 8; // command |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildSetPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPreset, BYTE bPan, BYTE bTilt, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = bAddress; // address |
|||
pBuffer[ 1] = 11; // length |
|||
pBuffer[ 2] = 4; // type |
|||
pBuffer[ 3] = 4; // command |
|||
pBuffer[ 4] = bPreset; // preset number |
|||
pBuffer[ 5] = bPan; // pan pos |
|||
pBuffer[ 6] = bTilt; // tilt pos |
|||
pBuffer[ 7] = 255; // pan speed |
|||
pBuffer[ 8] = 255; // tilt speed |
|||
pBuffer[ 9] = 0; // wait time L |
|||
pBuffer[10] = 0; // wait time H |
|||
pBuffer[11] = LOBYTE( wZoom ); // zoom pos L |
|||
pBuffer[12] = HIBYTE( wZoom ); // zoom pos H |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildGotoPreset( LPBYTE pBuffer, BYTE bAddress, BYTE bPreset ) |
|||
{ |
|||
pBuffer[0] = bAddress; // address |
|||
pBuffer[1] = 3; // length |
|||
pBuffer[2] = 2; // type |
|||
pBuffer[3] = 16; // command |
|||
pBuffer[4] = bPreset; // preset number |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildGotoPosition( LPBYTE pBuffer, BYTE bAddress, BYTE bPan, BYTE bTilt, WORD wZoom ) |
|||
{ |
|||
pBuffer[ 0] = bAddress; // address |
|||
pBuffer[ 1] = 11; // length |
|||
pBuffer[ 2] = 4; // type |
|||
pBuffer[ 3] = 4; // command |
|||
pBuffer[ 4] = 1; // preset number |
|||
pBuffer[ 5] = bPan; // pan pos |
|||
pBuffer[ 6] = bTilt; // tilt pos |
|||
pBuffer[ 7] = 255; // pan speed |
|||
pBuffer[ 8] = 255; // tilt speed |
|||
pBuffer[ 9] = 0; // wait time L |
|||
pBuffer[10] = 0; // wait time H |
|||
pBuffer[11] = LOBYTE( wZoom ); // zoom pos L |
|||
pBuffer[12] = HIBYTE( wZoom ); // zoom pos H |
|||
INT nSubCount = CheckSum( pBuffer ); |
|||
pBuffer[nSubCount + 0] = bAddress; // address |
|||
pBuffer[nSubCount + 1] = 3; // length |
|||
pBuffer[nSubCount + 2] = 2; // type |
|||
pBuffer[nSubCount + 3] = 16; // command |
|||
pBuffer[nSubCount + 4] = 1; // preset number |
|||
return nSubCount + CheckSum( pBuffer + nSubCount ); |
|||
} |
|||
|
|||
static INT BuildPan( LPBYTE pBuffer, BYTE bAddress, BOOL bRight, BYTE bSpeed ) |
|||
{ |
|||
pBuffer[0] = bAddress; // address |
|||
pBuffer[1] = 3; // length |
|||
pBuffer[2] = 2; // type |
|||
pBuffer[3] = bRight ? 1 : 129; // command |
|||
pBuffer[4] = bSpeed; // speed |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildTilt( LPBYTE pBuffer, BYTE bAddress, BOOL bUp, BYTE bSpeed ) |
|||
{ |
|||
pBuffer[0] = bAddress; // address |
|||
pBuffer[1] = 3; // length |
|||
pBuffer[2] = 2; // type |
|||
pBuffer[3] = bUp ? 2 : 130; // command |
|||
pBuffer[4] = bSpeed; // speed |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildZoom( LPBYTE pBuffer, BYTE bAddress, BOOL bFar, BYTE bSpeed ) |
|||
{ |
|||
pBuffer[ 0] = bAddress; // address |
|||
pBuffer[ 1] = 9; // length |
|||
pBuffer[ 2] = 1; |
|||
pBuffer[ 3] = ':'; |
|||
pBuffer[ 4] = 'W'; |
|||
pBuffer[ 5] = 'F'; |
|||
pBuffer[ 6] = 'C'; |
|||
pBuffer[ 7] = 'B'; |
|||
pBuffer[ 8] = 'B'; |
|||
if( bSpeed == 0 ) |
|||
{ |
|||
pBuffer[ 9] = 'F'; |
|||
pBuffer[10] = 'E'; |
|||
} |
|||
else |
|||
{ |
|||
if( bFar ) |
|||
{ |
|||
pBuffer[ 9] = '9'; |
|||
pBuffer[10] = '9'; |
|||
} |
|||
else |
|||
{ |
|||
pBuffer[ 9] = '9'; |
|||
pBuffer[10] = 'B'; |
|||
} |
|||
} |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildIris( LPBYTE pBuffer, BYTE bAddress, BYTE bLevel ) |
|||
{ |
|||
const BYTE pHex[] = "0123456789ABCDEF"; |
|||
pBuffer[ 0] = bAddress; // address |
|||
pBuffer[ 1] = 9; // length |
|||
pBuffer[ 2] = 1; |
|||
pBuffer[ 3] = ':'; |
|||
pBuffer[ 4] = 'W'; |
|||
pBuffer[ 5] = 'F'; |
|||
pBuffer[ 6] = 'D'; |
|||
pBuffer[ 7] = '9'; |
|||
pBuffer[ 8] = 'E'; |
|||
pBuffer[ 9] = pHex[ (bLevel >> 4) & 0x0F ]; |
|||
pBuffer[10] = pHex[ (bLevel >> 0) & 0x0F ]; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildSetAutoFocus( LPBYTE pBuffer, BYTE bAddress, BOOL bAuto ) |
|||
{ |
|||
const BYTE pHex[] = "0123456789ABCDEF"; |
|||
pBuffer[ 0] = bAddress; // address |
|||
pBuffer[ 1] = 9; // length |
|||
pBuffer[ 2] = 1; |
|||
pBuffer[ 3] = ':'; |
|||
pBuffer[ 4] = 'W'; |
|||
pBuffer[ 5] = 'F'; |
|||
pBuffer[ 6] = 'F'; |
|||
pBuffer[ 7] = '0'; |
|||
pBuffer[ 8] = 'E'; |
|||
pBuffer[ 9] = '2'; |
|||
pBuffer[10] = bAuto ? '2' : 'A'; |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
static INT BuildWarmBoot( LPBYTE pBuffer ) |
|||
{ |
|||
pBuffer[0] = 0; // address |
|||
pBuffer[1] = 2; // length |
|||
pBuffer[2] = 16; // type |
|||
pBuffer[3] = 32; // command |
|||
return CheckSum( pBuffer ); |
|||
} |
|||
|
|||
// conversion to normal units |
|||
public: |
|||
static CLgDevicePTZ::PTZ_DEGREE Pan2Degree( BYTE Pan ) |
|||
{ |
|||
return 360L - Pan * 360L / 256L; |
|||
} |
|||
|
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree1( BYTE Tilt ) |
|||
{ |
|||
return 90L - Tilt * 360L / 256L; |
|||
} |
|||
|
|||
static CLgDevicePTZ::PTZ_DEGREE Tilt2Degree2( BYTE Tilt ) |
|||
{ |
|||
return 90L - Tilt * 90L / 143L; |
|||
} |
|||
|
|||
static CLgDevicePTZ::PTZ_PERCENT Iris2Percent( BYTE iris ) |
|||
{ |
|||
return iris * 100L / 255L; |
|||
} |
|||
|
|||
static CLgDevicePTZ::PTZ_PERCENT Zoom2Percent( WORD zoom ) |
|||
{ |
|||
// const int zr = 0x2178; |
|||
// return ((double)(zoom + (WORD)0x108C)) * 100.0 / ((double)zr); |
|||
// const int zr = 0x2170; |
|||
const int zr = 0x2180; |
|||
if( HIBYTE(zoom) == 0xFF ) return -100; |
|||
return 100L - ((WORD)((WORD)zoom + (WORD)0x10BC)) * 100L / zr; |
|||
} |
|||
|
|||
static CLgDevicePTZ::PTZ_PERCENT Speed2Percent( BYTE speed ) |
|||
{ |
|||
return speed * 100L / 255L; |
|||
} |
|||
|
|||
// restrict value |
|||
static BOOL ValidatePan( CLgDevicePTZ::PTZ_DEGREE& pan ) |
|||
{ |
|||
// while( pan < 0.0 ) pan += 360.0; |
|||
// while( pan > 360.0 ) pan -= 360.0; |
|||
return TRUE; |
|||
} |
|||
static BOOL ValidateTilt( CLgDevicePTZ::PTZ_DEGREE& tilt ) |
|||
{ |
|||
if( tilt >= 0 ) |
|||
{ |
|||
if( tilt <= 90 ) return TRUE; |
|||
else tilt = 90; |
|||
} |
|||
else tilt = 0; |
|||
return FALSE; |
|||
} |
|||
static BOOL ValidateZoom( CLgDevicePTZ::PTZ_PERCENT& zoom ) |
|||
{ |
|||
if( zoom >= 0 ) |
|||
{ |
|||
if( zoom <= 100 ) return TRUE; |
|||
else zoom = 100; |
|||
} |
|||
else zoom = 0; |
|||
return FALSE; |
|||
} |
|||
|
|||
// conversion to device units |
|||
static BYTE Degree2Pan( CLgDevicePTZ::PTZ_DEGREE Angle ) |
|||
{ |
|||
return (BYTE)( ( (360L - Angle) * 256L ) / 360L ); |
|||
} |
|||
|
|||
static BYTE Degree2Tilt1( CLgDevicePTZ::PTZ_DEGREE Angle ) |
|||
{ |
|||
if( Angle > 90 ) Angle = 90; |
|||
if( Angle < 0 ) Angle = 0; |
|||
return (BYTE)( ( ( 90L - Angle ) * 255L ) / 360L ); |
|||
} |
|||
|
|||
static BYTE Degree2Tilt2( CLgDevicePTZ::PTZ_DEGREE Angle ) |
|||
{ |
|||
if( Angle > 90 ) Angle = 90; |
|||
if( Angle < 0 ) Angle = 0; |
|||
return (BYTE)( ( ( 90L - Angle ) * 143L ) / 90L ); |
|||
} |
|||
|
|||
static BYTE Percent2Iris( CLgDevicePTZ::PTZ_PERCENT percent ) |
|||
{ |
|||
if( percent > 100 ) percent = 100; |
|||
if( percent < 0 ) percent = 0; |
|||
return (BYTE)( percent * 255L / 100L ); |
|||
} |
|||
|
|||
static WORD Percent2Zoom( CLgDevicePTZ::PTZ_PERCENT percent ) |
|||
{ |
|||
const int zr = 0x2178; |
|||
int zv = (int)( zr * ( 100L - percent ) / 100L ); |
|||
if( zv < 0 ) zv = 0; |
|||
if( zv > zr ) zv = zr; |
|||
return (WORD)(((DWORD)zv) - 0x108CUL); |
|||
} |
|||
|
|||
static BYTE Percent2Speed( CLgDevicePTZ::PTZ_PERCENT percent ) |
|||
{ |
|||
if( percent > 100 ) percent = 100; |
|||
if( percent < 0 ) percent = 0; |
|||
return (BYTE)( percent * 255L / 100L ); |
|||
} |
|||
}; |
|||
|
|||
#endif |
|||
|
|||
#ifdef __BCPLUSPLUS__ |
|||
#pragma warn .inl |
|||
#endif |
|||
|
|||
@ -0,0 +1,214 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: ProtLGSm.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of ProtLGSm.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "..\StdAfx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Version.h"
|
|||
#include "..\LgLib\Comm\ProtLGSm.h"
|
|||
#else
|
|||
#include "..\Version.h"
|
|||
#include "ProtLGSm.h"
|
|||
#endif
|
|||
|
|||
CProtocolLGS::CProtocolLGS() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
} |
|||
|
|||
CProtocolLGS::~CProtocolLGS() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
bool CProtocolLGS::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return true; |
|||
} |
|||
|
|||
void CProtocolLGS::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
bool CProtocolLGS::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, bool bHost ) |
|||
{ |
|||
bool bResult = false; |
|||
|
|||
#ifdef _MSC_VER
|
|||
DWORD dwStartTime = ::GetTickCount(); |
|||
#endif
|
|||
|
|||
while( true ) |
|||
{ |
|||
// assume without read repeating
|
|||
bool bRepeat = false; |
|||
|
|||
// copy remaining part
|
|||
if( m_pBuffer != m_pBufferPtr ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// read data
|
|||
while( true ) |
|||
{ |
|||
if( m_nCount < HEADER_SIZE ) |
|||
{ |
|||
// try to read command header
|
|||
m_nCount += m_pConnection->Read( m_pBuffer + m_nCount, HEADER_SIZE - m_nCount, dwTimeout ); |
|||
if( m_nCount < HEADER_SIZE ) |
|||
{ |
|||
break; |
|||
} |
|||
} |
|||
|
|||
// check header tag
|
|||
if( m_pBuffer[ HEADER_POS ] == HEADER_TAG ) |
|||
{ |
|||
// validate possibility of lenght
|
|||
uint8_t bLength = ( m_pBuffer[ LENGTH_POS ] & LENGTH_MASK ); |
|||
if( bLength <= MAX_DATA_LENGTH ) |
|||
{ |
|||
// read remaining part
|
|||
DWORD nReadCount = bLength - (m_nCount - HEADER_SIZE) + 1; |
|||
m_nCount += m_pConnection->Read( m_pBuffer + m_nCount, nReadCount, dwTimeout ); |
|||
break; |
|||
} |
|||
else |
|||
memmove( m_pBuffer, m_pBuffer + 1, --m_nCount ); |
|||
} |
|||
else |
|||
memmove( m_pBuffer, m_pBuffer + 1, --m_nCount ); |
|||
|
|||
#ifdef _MSC_VER
|
|||
if( ::GetTickCount() - dwStartTime > dwTimeout ) |
|||
break; |
|||
#endif
|
|||
} |
|||
|
|||
// initialize pointer
|
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// parse input bytes
|
|||
while( m_nCount >= MIN_COMMAND_SIZE ) |
|||
{ |
|||
// check header tag
|
|||
if( m_pBufferPtr[ HEADER_POS ] == HEADER_TAG ) |
|||
{ |
|||
// validate possibility of lenght
|
|||
uint8_t bLength = ( m_pBufferPtr[ LENGTH_POS ] & LENGTH_MASK ); |
|||
if( bLength <= MAX_DATA_LENGTH ) |
|||
{ |
|||
// check current lenght
|
|||
if( ( bLength + MIN_COMMAND_SIZE ) > m_nCount ) |
|||
return false; |
|||
|
|||
// length without checksum
|
|||
int16_t bSubLength = bLength + HEADER_SIZE; |
|||
|
|||
// test checksum
|
|||
uint8_t bCheckSum = 0; |
|||
int16_t i; |
|||
for( i = 0; i < bSubLength; i++ ) |
|||
bCheckSum += m_pBufferPtr[ i ]; |
|||
|
|||
// if checksum ok
|
|||
if( bCheckSum == m_pBufferPtr[ i ] ) |
|||
{ |
|||
bool bFromHost = ( ( m_pBufferPtr[ LENGTH_POS ] & HOST_TAG ) == HOST_TAG ); |
|||
|
|||
// if right direction
|
|||
if( (bFromHost && !bHost) || (bHost && !bFromHost) ) |
|||
{ |
|||
// store length
|
|||
*pCount = bLength; |
|||
*ppBuffer = m_pBufferPtr + DATA_POS; |
|||
|
|||
// at least one command received
|
|||
bResult = true; |
|||
} |
|||
else |
|||
{ |
|||
// probably received echo - repeat reading
|
|||
bRepeat = true; |
|||
} |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += bSubLength; |
|||
m_nCount -= bSubLength; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr ++; |
|||
m_nCount --; |
|||
} |
|||
|
|||
// if not need to repeat reading
|
|||
if( !bRepeat ) |
|||
break; |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
bool CProtocolLGS::Write( PBYTE pBuffer, int16_t nCount, DWORD dwTimeout, bool bHost ) |
|||
{ |
|||
// validate data length
|
|||
if( nCount > MAX_DATA_LENGTH ) |
|||
return false; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// make pointer to write buffer
|
|||
PBYTE pBufferPtr = m_pBuffer; |
|||
|
|||
#ifdef LGS_PROTOCOL_TRANSMIT_DELAY
|
|||
// add small delay during transmition
|
|||
for( int16_t j = 0; j < LGS_PROTOCOL_TRANSMIT_DELAY; j++ ) |
|||
*pBufferPtr++ = 0; |
|||
#endif
|
|||
|
|||
// write header tag
|
|||
uint8_t bCheckSum = (*pBufferPtr++ = HEADER_TAG); |
|||
|
|||
// write data length
|
|||
bCheckSum += (*pBufferPtr++ = ( nCount | ( bHost ? HOST_TAG : 0 ) ) ); |
|||
|
|||
// write data
|
|||
for( int16_t i = 0; i < nCount; i++ ) |
|||
bCheckSum += (*pBufferPtr++ = *pBuffer++); |
|||
|
|||
// write check sum
|
|||
*pBufferPtr = bCheckSum; |
|||
|
|||
// write data
|
|||
#ifdef LGS_PROTOCOL_TRANSMIT_DELAY
|
|||
DWORD dwBytesToWrite = nCount + MIN_COMMAND_SIZE + LGS_PROTOCOL_TRANSMIT_DELAY; |
|||
#else
|
|||
DWORD dwBytesToWrite = nCount + MIN_COMMAND_SIZE; |
|||
#endif
|
|||
return m_pConnection->Write( m_pBuffer, dwBytesToWrite, dwTimeout ) == dwBytesToWrite; |
|||
} |
|||
@ -0,0 +1,146 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: ProtLGSm.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CProtocolLGS |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __PROTOCOL__MULTI__H__INCLUDED__ |
|||
#define __PROTOCOL__MULTI__H__INCLUDED__ |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\lglib\Comm\connect.h" |
|||
#include "..\lglib\Comm\protocol.h" |
|||
#else |
|||
#include "connect.h" |
|||
#include "protocol.h" |
|||
#endif |
|||
|
|||
class CProtocolLGS : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolLGS(); |
|||
~CProtocolLGS(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pCommPort ); |
|||
void Destroy(); |
|||
|
|||
public: |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
enum |
|||
{ |
|||
HEADER_POS = 0U, // position of header byte |
|||
LENGTH_POS = 1U, // position of data length byte |
|||
LENGTH_MASK = 0x7FU, // position of data length byte |
|||
DATA_POS = 2U, // position of first data byte |
|||
HEADER_SIZE = 2U, // header + length byte |
|||
MIN_COMMAND_SIZE = 3U, // header + length byte + checksumm byte |
|||
MAX_DATA_LENGTH = 60U, // maximun data size |
|||
MAX_COMMAND_SIZE = (MAX_DATA_LENGTH + MIN_COMMAND_SIZE), // command,length,data0..dataN,checksum (N < 32) |
|||
HEADER_TAG = 0x55, |
|||
HOST_TAG = 0x80, |
|||
}; |
|||
|
|||
private: |
|||
CConnection *m_pConnection; |
|||
BYTE m_pBuffer[ MAX_COMMAND_SIZE ]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
}; |
|||
/* |
|||
class CLgProtocolPipe |
|||
{ |
|||
public: |
|||
CLgProtocolPipe(); |
|||
~CLgProtocolPipe(); |
|||
|
|||
public: |
|||
BOOL PipeWrite( PBYTE pBuffer, INT nCount ); |
|||
BOOL PipeRead( PBYTE pBuffer, INT nCount ); |
|||
|
|||
protected: |
|||
virtual BOOL OnPipeWrite( PBYTE pBuffer, INT nWritten ) = 0; |
|||
virtual BOOL OnPipeRead( PBYTE pBuffer, INT nRead ) = 0; |
|||
|
|||
public: |
|||
enum{ MAX_BUFFER_SIZE = 2048 }; |
|||
BOOL Create( INT nBufferSize = MAX_BUFFER_SIZE ); |
|||
void Destroy(); |
|||
|
|||
public: |
|||
BOOL SubWrite( PBYTE pBuffer, INT nSubSize, PINT pWritten, BOOL bHost ); |
|||
BOOL SubRead( PBYTE pBuffer, INT nSubSize, PINT pRead, BOOL bHost ); |
|||
|
|||
private: |
|||
enum LG_E_PIPE_OPERATION{ LG_PIPE_OP_READ, LG_PIPE_OP_WRITE, LG_PIPE_OP_NONE }; |
|||
LG_E_PIPE_OPERATION m_eOperation; |
|||
|
|||
private: |
|||
LPBYTE m_pBuffer; |
|||
INT m_nBufferSize; |
|||
|
|||
private: |
|||
INT m_nPosition; |
|||
INT m_nRemain; |
|||
BYTE m_nOrder; |
|||
INT m_nLastSize; |
|||
|
|||
private: |
|||
enum |
|||
{ |
|||
LG_PIPE_SEND_CMD = 0, |
|||
LG_PIPE_SEND_EVT = 1, |
|||
LG_PIPE_RECEIVE_CMD = 2, |
|||
LG_PIPE_RECEIVE_EVT = 3, |
|||
}; |
|||
typedef struct |
|||
{ |
|||
BYTE nOrder; |
|||
BYTE nLast; |
|||
WORD nPosition; |
|||
BYTE nSize; |
|||
}LG_PIPE_SEND_CMD_DATA; |
|||
typedef struct |
|||
{ |
|||
BYTE nOrder; |
|||
WORD nPosition; |
|||
}LG_PIPE_SEND_EVT_DATA; |
|||
typedef struct |
|||
{ |
|||
BYTE nOrder; |
|||
WORD nPosition; |
|||
}LG_PIPE_RECEIVE_CMD_DATA; |
|||
typedef struct |
|||
{ |
|||
BYTE nOrder; |
|||
BYTE nLast; |
|||
WORD nPosition; |
|||
BYTE nSize; |
|||
}LG_PIPE_RECEIVE_EVT_DATA; |
|||
typedef struct LG_PIPE_DATA |
|||
{ |
|||
BYTE nCommand; |
|||
union |
|||
{ |
|||
LG_PIPE_SEND_CMD_DATA sendcmd; |
|||
LG_PIPE_SEND_EVT_DATA sendevt; |
|||
LG_PIPE_RECEIVE_CMD_DATA receivecmd; |
|||
LG_PIPE_RECEIVE_EVT_DATA receiveevt; |
|||
}; |
|||
}LG_PIPE_DATA, *PLG_PIPE_DATA; |
|||
#pragma pack() |
|||
}; |
|||
*/ |
|||
|
|||
#endif |
|||
@ -0,0 +1,169 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: ProtPTZm.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of ProtPTZm.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\Version.h"
|
|||
#include "..\LgLib\Comm\ProtPTZm.h"
|
|||
#else
|
|||
#include "..\Version.h"
|
|||
#include "ProtPTZm.h"
|
|||
#endif
|
|||
|
|||
CProtocolMigvanPTZ::CProtocolMigvanPTZ() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_bAddress = 0; |
|||
m_bReadAnyAddress = FALSE; |
|||
} |
|||
|
|||
CProtocolMigvanPTZ::~CProtocolMigvanPTZ() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolMigvanPTZ::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolMigvanPTZ::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
BOOL CProtocolMigvanPTZ::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( ( m_pBuffer != m_pBufferPtr ) && m_nCount ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
DWORD nReadCount = 0; |
|||
|
|||
// try to read command header
|
|||
if( m_nCount < HEADER_SIZE ) |
|||
{ |
|||
// read new data
|
|||
DWORD nCount = HEADER_SIZE - m_nCount; |
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nCount, dwTimeout ) ); |
|||
} |
|||
|
|||
if( m_nCount >= HEADER_SIZE ) |
|||
{ |
|||
// check header tag
|
|||
if( m_pBuffer[ ADDRESS_POS ] == 0 || |
|||
m_pBuffer[ ADDRESS_POS ] == m_bAddress || |
|||
m_bReadAnyAddress ) |
|||
{ |
|||
// validate possibility of lenght
|
|||
BYTE bLength = m_pBuffer[ LENGTH_POS ]; |
|||
if( bLength <= MAX_DATA_LENGTH ) |
|||
{ |
|||
nReadCount = bLength - (m_nCount - HEADER_SIZE) + 1; |
|||
} |
|||
else |
|||
nReadCount = MAX_COMMAND_SIZE - m_nCount; |
|||
} |
|||
else |
|||
nReadCount = MAX_COMMAND_SIZE - m_nCount; |
|||
} |
|||
else |
|||
nReadCount = MAX_COMMAND_SIZE - m_nCount; |
|||
|
|||
// read new data
|
|||
m_nCount += ( m_pConnection->Read( m_pBuffer + m_nCount, nReadCount, dwTimeout ) ); |
|||
|
|||
// initialize pointer
|
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// parse input bytes
|
|||
while( m_nCount >= MIN_COMMAND_SIZE ) |
|||
{ |
|||
// check header tag
|
|||
if( m_bReadAnyAddress || |
|||
m_pBufferPtr[ ADDRESS_POS ] == m_bAddress || |
|||
m_pBufferPtr[ ADDRESS_POS ] == 0 ) |
|||
{ |
|||
// validate possibility of lenght
|
|||
BYTE bLength = m_pBufferPtr[ LENGTH_POS ]; |
|||
if( bLength <= MAX_DATA_LENGTH ) |
|||
{ |
|||
// check current lenght
|
|||
if( ( bLength + MIN_COMMAND_SIZE ) > m_nCount ) |
|||
return FALSE; |
|||
|
|||
// length without checksum
|
|||
BYTE bSubLength = bLength + HEADER_SIZE; |
|||
|
|||
// test checksum
|
|||
BYTE bCheckSum = 0; |
|||
INT i; |
|||
for( i = 0; i < bSubLength; i++ ) |
|||
bCheckSum += m_pBufferPtr[ i ]; |
|||
|
|||
// if checksum ok
|
|||
if( bCheckSum == m_pBufferPtr[ i ] ) |
|||
{ |
|||
// store length
|
|||
(*pCount) = (INT)bLength; |
|||
(*ppBuffer) = m_pBufferPtr; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += bSubLength; |
|||
m_nCount -= bSubLength; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr ++; |
|||
m_nCount --; |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolMigvanPTZ::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
bHost; |
|||
|
|||
// validate data length
|
|||
if( nCount > MAX_COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// write data
|
|||
DWORD dwDataSize = nCount; |
|||
return (BOOL)(m_pConnection->Write( pBuffer, dwDataSize, dwTimeout ) == dwDataSize); |
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: ProtPTZm.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CProtocolMigvanPTZ |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __PROT__PTZ__M__H__INCLUDED__ |
|||
#define __PROT__PTZ__M__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif |
|||
|
|||
#ifdef __BORLANDC__ |
|||
#include "..\LgLib\Comm\Connect.h" |
|||
#include "..\LgLib\Comm\Protocol.h" |
|||
#else |
|||
#include "Connect.h" |
|||
#include "Protocol.h" |
|||
#endif |
|||
|
|||
class CProtocolMigvanPTZ : public CProtocol |
|||
{ |
|||
public: |
|||
CProtocolMigvanPTZ(); |
|||
virtual ~CProtocolMigvanPTZ(); |
|||
|
|||
public: |
|||
BOOL Create( CConnection *pConnection ); |
|||
void Destroy(); |
|||
|
|||
public: |
|||
void SetAddress( BYTE bAddress ) { m_bAddress = bAddress; } |
|||
void SetReadAnyAddress( BOOL bReadAnyAddress ) { m_bReadAnyAddress = bReadAnyAddress; } |
|||
|
|||
public: |
|||
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ); |
|||
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ); |
|||
|
|||
public: |
|||
enum { |
|||
ADDRESS_POS = 0U, // position of header byte |
|||
LENGTH_POS = 1U, // position of data length byte |
|||
TYPE_POS = 2U, // position of command type byte |
|||
COMMAND_POS = 3U, // position of command byte |
|||
HEADER_SIZE = 2U, // address byte + length byte |
|||
MIN_COMMAND_SIZE = 3U, // address byte + length byte + checksumm byte |
|||
MAX_DATA_LENGTH = 20U, // maximun data size |
|||
MAX_COMMAND_SIZE = (MAX_DATA_LENGTH + MIN_COMMAND_SIZE), // command,length,data0..dataN,checksum (N < 32) |
|||
}; |
|||
|
|||
private: |
|||
CConnection*m_pConnection; |
|||
BYTE m_pBuffer[MAX_COMMAND_SIZE]; |
|||
PBYTE m_pBufferPtr; |
|||
INT m_nCount; |
|||
|
|||
private: |
|||
BYTE m_bAddress; |
|||
|
|||
private: |
|||
// covers bug in protocol (command "QUERY DOME ADDRESS") |
|||
BOOL m_bReadAnyAddress; |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,36 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: Protocol.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of Protocol.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
#include "..\stdafx.h"
|
|||
|
|||
#ifdef __BORLANDC__
|
|||
#include "..\LgLib\version.h"
|
|||
#include "..\LgLib\Comm\Protocol.h"
|
|||
#else
|
|||
#include "..\version.h"
|
|||
#include "Protocol.h"
|
|||
#endif
|
|||
|
|||
bool CProtocol::Transaction( PBYTE pRequest, int16_t nRequest, PBYTE *ppResponse, PINT pResponse, DWORD dwTimeout, int16_t nRetryCount, bool bHost ) |
|||
{ |
|||
for( int i = 0; i < nRetryCount; i++ ) |
|||
{ |
|||
if( !Write( pRequest, nRequest, dwTimeout, bHost ) ) |
|||
return false; |
|||
|
|||
if( Read( ppResponse, pResponse, dwTimeout, bHost ) ) |
|||
return true; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Laser Guard Ltd. |
|||
// Copyright © 2000-2002. All Rights Reserved. |
|||
// Version 1.0 01/01/2000 |
|||
// Last modification: 08/10/2003 |
|||
// PROJECT: Laserguard libraries |
|||
// SUBSYSTEM: Communication support library |
|||
// FILE: Protocol.h |
|||
// AUTHOR: Chizhevskiy Sergey |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of CProtocol |
|||
//---------------------------------------------------------------------------- |
|||
|
|||
#ifndef __PROTOCOL__H__INCLUDED__ |
|||
#define __PROTOCOL__H__INCLUDED__ |
|||
|
|||
#if _MSC_VER > 1000 |
|||
#pragma once |
|||
#endif |
|||
|
|||
class CProtocol |
|||
{ |
|||
public: |
|||
virtual BOOL Write( PBYTE pRequest, INT dwSize, DWORD dwTimeout, BOOL bHost ) = 0; |
|||
virtual BOOL Read( PBYTE *ppResponse, PINT pSize, DWORD dwTimeout, BOOL bHost ) = 0; |
|||
|
|||
public: |
|||
virtual BOOL Transaction( PBYTE pRequest, INT nRequest, PBYTE *ppResponse, PINT pResponse, DWORD dwTimeout, INT nRetryCount, BOOL bHost ); |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,132 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Laser Guard Ltd.
|
|||
// Copyright © 2000-2002. All Rights Reserved.
|
|||
// Version 1.0 01/01/2000
|
|||
// Last modification: 08/10/2003
|
|||
// PROJECT:
|
|||
// SUBSYSTEM:
|
|||
// FILE: ProtocolCCC.cpp
|
|||
// AUTHOR: Sergey Chizhevskiy
|
|||
// OVERVIEW
|
|||
// ~~~~~~~~
|
|||
// Source file of ProtocolCCC.cpp
|
|||
//----------------------------------------------------------------------------
|
|||
// ProtocolCCC.cpp: implementation of the CProtocolCCC class.
|
|||
//
|
|||
//////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "stdafx.h"
|
|||
#include "ProtocolCCC.h"
|
|||
|
|||
//////////////////////////////////////////////////////////////////////
|
|||
// Construction/Destruction
|
|||
//////////////////////////////////////////////////////////////////////
|
|||
|
|||
CProtocolCCC::CProtocolCCC() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
} |
|||
|
|||
CProtocolCCC::~CProtocolCCC() |
|||
{ |
|||
Destroy(); |
|||
} |
|||
|
|||
BOOL CProtocolCCC::Create( CConnection *pConnection ) |
|||
{ |
|||
Destroy(); |
|||
|
|||
m_pConnection = pConnection; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
|
|||
return TRUE; |
|||
} |
|||
|
|||
void CProtocolCCC::Destroy() |
|||
{ |
|||
m_pConnection = NULL; |
|||
m_pBufferPtr = m_pBuffer; |
|||
m_nCount = 0; |
|||
} |
|||
|
|||
BOOL CProtocolCCC::Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
BOOL bResult = FALSE; |
|||
|
|||
// copy remaining part
|
|||
if( m_pBuffer != m_pBufferPtr ) |
|||
memcpy( m_pBuffer, m_pBufferPtr, m_nCount ); |
|||
|
|||
// read data
|
|||
while( TRUE ) |
|||
{ |
|||
if( m_nCount < COMMAND_SIZE ) |
|||
{ |
|||
// try to read address byte
|
|||
m_nCount += m_pConnection->Read( m_pBuffer + m_nCount, COMMAND_SIZE - m_nCount, dwTimeout ); |
|||
if( m_nCount < COMMAND_SIZE ) |
|||
{ |
|||
break; |
|||
} |
|||
} |
|||
|
|||
// check address tag
|
|||
if( ( m_pBuffer[ ADDRESS_POS ] & ADDRESS_TAG ) == ADDRESS_TAG && |
|||
( m_pBuffer[ DATA_POS ] & ADDRESS_TAG ) != ADDRESS_TAG && |
|||
( m_pBuffer[ DATA_POS ] & DATA_TAG ) == DATA_TAG ) |
|||
{ |
|||
break; |
|||
} |
|||
else |
|||
memmove( m_pBuffer, m_pBuffer + 1, --m_nCount ); |
|||
} |
|||
|
|||
// initialize pointer
|
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// parse input bytes
|
|||
while( m_nCount >= COMMAND_SIZE ) |
|||
{ |
|||
// check address tag
|
|||
if( ( m_pBufferPtr[ ADDRESS_POS ] & ADDRESS_TAG ) == ADDRESS_TAG && |
|||
( m_pBufferPtr[ DATA_POS ] & ADDRESS_TAG ) != ADDRESS_TAG && |
|||
( m_pBufferPtr[ DATA_POS ] & DATA_TAG ) == DATA_TAG ) |
|||
{ |
|||
// store length
|
|||
*pCount = 2; |
|||
*ppBuffer = m_pBufferPtr; |
|||
|
|||
// at least one command received
|
|||
bResult = TRUE; |
|||
|
|||
// shift pointers
|
|||
m_pBufferPtr += 2; |
|||
m_nCount -= 2; |
|||
} |
|||
else |
|||
{ |
|||
// shift pointers
|
|||
m_pBufferPtr ++; |
|||
m_nCount --; |
|||
} |
|||
} |
|||
|
|||
return bResult; |
|||
} |
|||
|
|||
BOOL CProtocolCCC::Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost ) |
|||
{ |
|||
// validate data length
|
|||
if( nCount > COMMAND_SIZE ) |
|||
return FALSE; |
|||
|
|||
// clear receiver
|
|||
m_nCount = 0; |
|||
m_pBufferPtr = m_pBuffer; |
|||
|
|||
// make pointer to write buffer
|
|||
return m_pConnection->Write( pBuffer, nCount, dwTimeout ) == (DWORD)nCount; |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue