Professional Documents
Culture Documents
(76) Inventors: Karlheinz Dorn, Kalchreuth (DE); (51) Int. Cl." .............................. G06F 15/16; G06F 9/46
Detlef Becker, Moehrendorf (DE); (52) U.S. Cl. ............................................ 709/217; 709/313
Dietrich Quehl, Erlangen (DE)
(57) ABSTRACT
Correspondence Address:
SCHIFF HARDIN & WATE A medical System architecture with a modality (1 through 4)
6600 SEARS TOWER for the acquisition of images, a means (5 through 8, 11, 12)
233 SWACKER DR for processing the images and a means (9) for the transmis
CHICAGO, IL 60606-6473 (US) sion of the images. The means (5 through 8, 11, 12) for
processing comprises a digital image System with a com
puter that works according to a method for data eXchange
(21) Appl. No.: 09/881,492 between various application programs (OLE) with graphic
control elements and a standard for OLE Custom Controls
(22) Filed: Jun. 14, 2001 (OCX), whereby an OCX software component (18) is allo
cated to every individual process limited by boundaries,
these OCX Software components being expanded with an
Related U.S. Application Data OLE Automation or ATOMIC remote control component
(19, 22, 27 through 31, 35 through 41) so that the devices
(63) Continuation-in-part of application No. 08/883,303, and processes can be remote controlled without any limita
filed on Jun. 27, 1997, now abandoned. tions caused by address Space or computer boundaries.
View
DL
Proc
Server
Automation interface
LOCa Controller FSM 21 Control
Server 20 - : Automation
--
interface 27
Automation interface 28
Sever
23
\t
is as
a lice
Automation interface 30
local ev, ce. Model
1 2 3 4
471
Rosa
N. MY
22
2
2. 261
E.
2 242
/
-5 G-6 7 -8
9
15
NETWORK F)
NETWORK
INTERFACE
11 ses
-12
See 10
FIG 1
Patent Application Publication Sep. 5, 2002 Sheet 2 of 6 US 2002/0124054A1
18
w
OCX View
DLL- Automation interface 19
InProc
Server Pucal
Automation interface 22
LOCal Controller FSM 21 Control
Server 20 - Automation interface
--- -27.
Automation Interface 30
LOcal : Sea V ca. Model
Sevice
Automation interface
S
Patent Application Publication Sep. 5, 2002 Sheet 3 of 6 US 2002/0124054A1
F
18
View
DLL- Autonnation interface 19
is
Server a rows
Automation interface 22.
DLL Controller FSM 21 Control
Automation interface -27
Automation Interface 28
Jaa l/a Ca.
B s 25 Model
LOCal 23\
Server Automation interface u29:
S. A. S.
Automation interface 30
LOCal 24 4A3 WCell Model
Server N 26 l
: Automation interface 3
Patent Application Publication Sep. 5, 2002 Sheet 4 of 6 US 2002/0124054 A1
DLL View
nProC
Server
Automation interface 28
DLL &ea V (Ca. 25 : Model
29:
Automation interface
SA A
Patent Application Publication Sep. 5, 2002 Sheet 5 of 6 US 2002/0124054 A1
y
f
V
18
OCX View
DLL
nProC Automation interface 19
Server
Automation interface
DLL N Controller FSM 21 Control
Automation interface
S t
Automation interface
DLL
40 ab
St
po as a a
i.
Sé/gvica.
Automation interface
AS
is a as as p - - -
Model
Automation Interface
Local
Server
t
S4 (3 v/ca
Automation Interface
Model
Patent Application Publication Sep. 5, 2002 Sheet 6 of 6 US 2002/0124054 A1
DLL View
nProC
Server
23 38.
\ 25, Model
Local
Server 39
24\ 40
LOCal Model
Server 26
US 2002/O124054A1 Sep. 5, 2002
MEDICAL SYSTEMARCHITECTURE BASED ON 0010. The transfer of medical images between self-con
MICROSOFT OLE/OCX AND AUTOMATION OR, tained components (and other programs as well) is carried
RESPECTIVELY, ATOMIC out by usage of the DICOM protocol. The DICOM protocol
enables image transfer between imaging modalities of dif
CROSS-REFERENCE TO RELATED ferent manufacturers. DICOM (Digital Imaging and Com
APPLICATION munications in Medicine) is an industrial standard which
was developed by the American College of Radiology
0001. The present application is a Continuation-In-Part (ACR) and the National Electrical Manufacturers Associa
Application of Ser. No. 08/883,303, Filed Jun. 27, 1997. tion (NEMA). DICOM 3.0 is implemented by the Radiology
Society of North America (RSNA) Electronic Communica
BACKGROUND OF THE INVENTION tions Committee. DICOM is discussed at http://www.r-
Sna.org/practice/DICOM/dicom.html on the internet.
0002) 1. Field of the Invention
0011. The design of the self-contained software compo
0003. The present invention is directed to a medical nents (especially non-GUI components) follows the rules of
System architecture with a modality for acquiring images, a the Software ICS for high level application frameworks,
device for processing the images and a device for the which is the Subject of co-pending application Ser. No.
transmission of the images, whereby the device for proceSS 09/773,949, filed Feb. 1, 2001, which is a CIP application of
ing comprises a digital imaging System with a computer that the application Ser. No. 08/675,846, filed Jul. 6, 1996, and
WorkS according to a method for data eXchange between which is incorporated herein by reference.
various application programs (OLE) with graphic control
elements and a standard for OLE Custom Controls (OCX), 0012. The components are coupled loosely by means of
whereby an OCX software module is loaded into the virtual an location transparent (invisible) event propagation mecha
address Space of every process. nism. The reference to invisible connections refers to loca
tion-transparent connections, Such as that disclosed in
0004 2. Description of the Related Art ATOMIC (Asynchronous Transport Optimizing observer
pattern-like approach Supporting several Modes (client/
0005. As described, for example, in the book by Heinz server-push/pull) for an IDL-less Conmnunication Sub
Momeburg, “Bildgebende Systeme fuir medizinische Diag System, which is the Subject of co-pending patent
nostik, Erlangen, Publicis MCD-Verlag, 3rd Edition 1995, application Ser. No. 08/676,859, filed Jul. 7, 1996, and
pages 680-697, medical Systems are becoming more and which is incorporated herein by reference).
more complex, whereas the degree of expansion of medical
Systems increases to the same proportion. As a result thereof, 0013 The above and other objects and advantages are
however, an extremely flexible architecture is required. inventively achieved in that the System architecture is fash
ioned such that the OCX software components are-extended
0006 Previously known architectures were not designed by a remote control component, which Supports an asyn
in compliance with distributed, asynchronous Software and chronous working model needed for non-blocking GUIs.
reusable, Self-contained Software components. In other The self-contained components can be distributed within a
words, a monolithic Software architecture approach was Single computer as well as over a network of computers
used. without the limitations found in previous Software architec
0007. Despite the use of object orientation, further, the tures. A good Solution of the objects derives by combination
Simple use of class libraries prevents the design of flexible of Software components (or objects) and a distributed event
and re-employable components since, in reality, classes are propagation mechanism.
not truly re-employable on a large Scale. One of the reasons 0014. It has proven advantageous when the remote con
of this lack of reusability is the outgrowth of C++ inherit trol component is an OLE Automation interface and the
ance where lots of different classes derive from others and remote control ensues according to the OLE Automation
result in huge unmaintainable Software blockS. Standard. Inventively, the remote control component can be
an automation interface module.
SUMMARY OF THE INVENTION 0015. An alternative advantageous solution derives when
0008. The present invention is based on the object of the remote control ensues with Software-IC connections, for
providing Software components (or objects) that exhibit a example according to the ATOMIC Standard. According to
behavior that is independent from other components as far as the invention, the remote control component can be a
possible. Further the connections between the components connectable/remote interface module in this case.
should be invisible in relationship to the location of these 0016. It has proven advantageous when the method for
components (or objects), So that they can either all be data exchange is the Microsoft standard OLE and the
combined in one process (local server), or combined in standard for OLE Custom Controls is the Microsoft standard
different processes (local Servers) of a computer, or can be OCX.
distributed into different processes (local servers) located at 0017. The present invention provides that the medical
Several computers connected to a network.
system architecture can employ Microsoft OCX for produc
0009 For purposes of the present invention, an indepen ing components for graphic user Surfaces within a MicroSoft
dent component is defined as a Substantially Self-contained container process, whereby Microsoft OCX can be com
component-having-no link-time (by design) dependency on bined with OLE Automation and/or with software ICs (for
other Software components and generally capable of opera example, the ATOMIC standard) for distributed propagation
tion independent from the execution of other components. of events within all levels of the architecture.
US 2002/O124054A1 Sep. 5, 2002
0.018. An important new feature is the combination of example, the images generated in the modalities 1 through
Microsoft OLE Custom Controls (OCX), a newly created 4 can be Stored in a central image Store, or memory, 10 or
Software technology, with another, general MicroSoft Script can be forwarded to other work stations 5 through 8.
ing Standard interface that serves as a fully distributable
network-wide mechanism for the propagation of an event 0028. Further work stations that can be connected to a
(referred to as an event propagation mechanism) as Soon as local image Store, or memory, 13 and 14, which is for
network-wide OLE is available in order to obtain a realistic example a jukebox, can be connected to the image commu
Model View Controller concept (MVC) based system archi nication network as diagnosis consoles 11 and 12. The
tecture. images that are acquired and deposited in the central image
Store 10 can be Subsequently called in the diagnosis consoles
0019 Preferably, Microsoft OCX can also be employed 11 and 12 and be deposited in the local image store 13 and
for producing components for graphic user Surfaces (Graphi 14 from which they can be directly available to a diagnos
cal User Interface (GUI) components) within a Microsoft tician working at the diagnosis consoles 11 or 12.
container process. As a result thereof, one obtains truly
binarity compatible, re-employable GUI components. 0029) A network interface 15 via which the internal
image communication network 9 is connected to a global
0020) Further, Microsoft OCX can be inventively com data network can be connected to the image communication
bined with OLE Automation and with Software-IC connec network 9, So that the Standardized data can be exchanged
tions for the distributed propagation of an event (referred to worldwide with different networks.
as an event propagation) with local between all components.
This provides the flexibility for the distribution of compo 0030 This image data exchange via the image commnu
nents over the network combined with binary-compatible nication network 9 thereby ensues according to the DICOM
interfaces based on shared libraries. Objects which are Standard that is widespread in medical Systems, which is an
distributable and GUI dependent as well as not GUI-depen industrial Standard for the transmission of images and other
dent are thus obtained. medical information between computers for enabling digital
communication between diagnostic and therapy apparatus of
0021. This combination of software-ICs and OCX/Auto different manufacturers.
mation interfaces enables an execution architecture to define
executable processes not by design but mainly by configu 0031. The complexity of medical imaging systems is
ration of shared program components (shared libraries (or increasing rapidly. Thus a major requirement on a System
DLLs-dynamic link libraries)) at runtime together with the architecture is the reuse of proven parts of the Software.
possibility of Scripting. More and more imaging modalities are connected to a
clinical network and must be able to inter-operate with each
BRIEF DESCRIPTION OF THE DRAWINGS other. This requires that a System architecture enables the
0022. The present invention is explained in greater detail Software to use network wide Services Such as image Stores
on remote computers. Although the image acquisition Sys
below on the basis of exemplary embodiments shown in the tems of the modalities (MR, CT, etc.) are completely dif
drawing. Shown are: ferent, there is a lot of functionality which is identical for all
0023 FIG. 1 is a block diagram of a medical computer modalities (e.g. patient registration, archiving, networking,
network of the related art; image Viewing, image processing, filming, etc.). The System
0024 FIGS. 2, 34 and 5 are functional block diagrams architecture must provide means for reuse of Such com
monly used functionality designed for one of the modalities
showing the inventive collaboration of the software com on otherS modalities without programming. This requires
ponents according to a first exemplary embodiment, and that this Software does not depend on modality Specific
0.025 FIG. 6 is a functional block diagram illustrating environment.
the inventive collaboration of the Software components 0032. The present invention deals with these require
according to a Second exemplary embodiment. ments by defining a System architecture according to the
DETAILED DESCRIPTION OF THE MVC concept (Mode View Controller). A functionality or
PREFERRED EMBODIMENTS So-called application (e.g. patient registration) is divided
into three parts (i.e. 3 tiers), the view (a thin client) which
0.026 FIG. 1 shows the system architecture of a medical provides means for a graphical user interface, a controller
computer network. The modalities 1 through 4 serve for the that contains the business logic (validation of patient data
acquisition of medical images and can comprise, for like Sex, weight, age, etc.), and one or more models (ser
example a CT unit 1 for computer tomography, an MR unit vices) like database Systems or network connections. These
2 for magnetic resonance, a DSA unit 3 for digital Subtrac three parts (tiers) of an application are build according to the
tion angiography and an X-ray unit 4 for digital radiography Software-IC concept, which allows distribution and runtime
as image-generating Systems. Work Stations 5 through 8 with configuration in different processes. These three parts (tiers)
which the modalities 1 through 4 can be controlled and the of an application are coupled tightly as a result of their
acquired medical images can be processed and Stored can be Semantics.
connected to these modalities 1 through 4. For example, 0033. The coupling of different applications is loosely by
such work stations 5 through 8 are very fast small computers means of events. An example of loosely coupling is the
having one or more fast processors. event propagated by the image acquisition application after
0027. The work stations 5 through 8 are connected to an the acquisition finished. The image viewing application can
image communication network 9 for the distribution of the display the newly acquired imageS as a reaction of this
generated images and for communication. Thus, for event. If there is no image viewing application configured on
US 2002/O124054A1 Sep. 5, 2002
this modality, the event is ignored. Tight coupling of these ponents 25 and 26 are coupled to one another via further
applications (e.g. by link-time dependencies) would always Automation Interface components 27 through 31.
require the image viewing application to be installed on this 0040. The structure is essentially the same in FIGS. 3
computer. This loosely coupling between applications through 5; the configuration of the components into pro
allows them to be reused all together or in parts by other cesses is merely different. Whereas all MVC components in
modalities by simply configuring these components (Soft the first case according to FIG. 2 are respectively arranged
ware-ICs) at runtime. in a separate process, the View and control components in
0034. The present invention combines the advantages of the example according to FIG.3 are arranged in one process
both, the software-ICs and the OLE/OCX technology by and the model components are arranged in Separate pro
applying a remote control component. The Software-ICS cesses. This means that the control level of the controller 21
provide means for building self-contained and fully distrib is already located in the same dynamic link library (DLL) of
utable components with a location transparent and asynchro a in-process Server 32 as the application program 17 of the
nous (non-blocking) event propagation mechanism. The View component.
OCX technology allows the usage of different progratming 0041. In the subject matter according to FIG. 4, the
languages (e.g. Visual C++, Visual Basic, etc.). The remote control and model components are combined in one process
control comrponent uses the event propagation mechanism and are located in the same dynamic link library (DLL) of
according to ATOMIC as the external asynchronous inter the local server 33. Preferably, there is also the possibility of
face to be used for communication between components and configuring the View, control and model components accord
the Synchronous OLE automation interface as the internal ing to FIG. 5 into one process in the dynamic link library
interface to the component. The Synchronous internal auto (DLL) of an in-process server 34, whereby a further service
mation interface of the remote control component allows component is contained in a further local Server 24.
non-thread-Safe programming of the component while the
asynchronous (non-blocking) external interface provides 0042 FIG. 6 shows a second example according to the
means for queuing of the input and output events. Another MVC concept (model view controller) that is similar to the
advantage of the remote control component is it's role as a example of FIG. 2. Here, too, the View area is again located
mediator between the external and the internal interface and in a dynamic link library (DLL) of the in process server 16.
thus allows the modification of the component's program What are referred to as software-IC connection 35 (connect
code (business logic) without the risk of changes of the able/remote) are coupled to the OCX software components
external interface. 18 of the application program 17 loaded in the server 16 as
0035 FIG. 2 shows a first example of a software archi remote control components instead of the Automation Inter
tecture according to the MVC concept (Model View Con face components 19. The communication with other local
troller) wherein the view, control and model components are servers 20, 23 and 24 is enabled with these components. The
respectively contained in different processes. The View area controller 21 in the local server 20 can thus be for coupling
is located in a dynamic link library (DLL) of an in-process the View component with the model component. This con
server 16. troller is likewise coupled to corresponding Software-IC
connections 36 and 37. The model component is arranged in
0036) A dynamic link library is a collection of object files the local servers 23 and 24 in which the service components
that are (dynamically) linked (made available) at the run 25 and 26 are contained via further Software-IC connections
time of a proceSS and that can be simultaneously shared by 38 through 41, which is the subject of co-pending patent
a plurality of processes. The implementation of a Service is application Ser. No. 09/773,949, filed Feb. 1.2001, which is
realized Such that given the in-proceSS Server 16 this Service a CIP application of the application Ser. No. 08/675,846,
must always run in the same proceSS as the client who filed Jul. 6, 1996, and which is incorporated herein by
requires this Service. DLLS are particularly Suitable therefor reference.
Since they make the Service dynamically available to the 0043. These connectable/remote software-IC remote
proceSS on demand. control components are fully distributable input/output
0037. The application program, which comprises a plu events based on an event-communicating network that is
rality of OCX software components 18, is loaded in the dynamically loadable and configurable by input/output con
server 16. Automation Interface components 19 of the OLE nections points.
Automation Standard are coupled to the OCX components 0044) The advantage of this inventive proposal is its
18 as remote control components. These components make flexibility and, even more, its productivity for achieving
it possible to communicate with other local Servers. A Software components which are re-employable in various
controller 21 for coupling the view level with the model medical System product architectures.
level can thus be stored in a second local server 20. This
controller 21 is likewise coupled to a corresponding Auto 004.5 The software-IC connections allow a truly arbitrary
mation Interface component 22. distribution of the components in executable processes with
out ending up in lock-up States as can be the case in other
0.038. The controller 21 is a component from the model communication mechanisms (for example, Corba) without
view component (MVC) world. The view thereby represents Source code modification. The components can even be
a way of viewing the model. Model and view are coupled via arbitrarily combined at the run time as a result thereof.
a controller component. This controller component is essen Another advantage is that the connections can be n:m
tially composed of an automatic State unit, what is referred connections (n Suppliers and m consumers), which is usually
to as a fmite state machine (FSM). not possible in traditional Systems, whereby the connection
0.039 The model component can be contained in two parties anonymously find one another at the run time accord
further local servers 23 and 24 in which the service com ing to ATOMIC.
US 2002/O124054A1 Sep. 5, 2002
0046. In addition, the component connections also differ cation and includes Structure corresponding to the figures of
from traditional connections in that event data are transmit the present application. Further, GUIs and a complete Source
ted on the connections and no remote methods are called. code for all three tiers and the ATOMIC based communi
The usage of remote methods makes it difficult to adapt the cation Source code for the remote control component is
busineSS logic of a component to the needs of new imaging presented.
Systems without braking the Signature and the Semantic of 0048 Although other modifications and changes maybe
the component's external interface. Suggested by those skilled in the art, it is the intention of the
0047. An example of a use case for the present medical inventors to embody within the patent warranted hereon all
System architecture is shown in an Appendix, attached changes and modifications as reasonably and properly come
hereto. The example utilizes the terms of the present appli within the scope of their contribution to the art.
US 2002/0124054 A1 Sep. 5, 2002
APPEND IX
CONTINUATION-IN-PART APPLICATION
entitled: MEDICAL SYSTEMARCHITECTURE BASED ON MICROSOFT OLE/OCXAND
AUTOMATION OR, RESPECTIVELY, ATOMIC
US 2002/0124054 A1 Sep. 5, 2002
The Remotecontrol ComponentOCX class collaborates with the ATOMIC standard classes to
attach to Application and Modality channels or to the command handling system that
implements proxies,command objects and returns. It runs typically within the context of a
MacroOCX as a non-visual MicroOCX all dispatched via a generic CapGM frontend container
executable. In case that a different 3-rd-party container is used, the
Remote(ControlComponentOCX can be switched into a mode where it is able to do all
necessary dispatching (behaving like a CapGM without a GUI) in addition to its other roles.
A generalized RemotecontrolComponentOCX is depicted in the figure below, along with the
general User Interface and Backend objects that it collaborates with. The
RemoteControlcomponentOCX uses the Command-, Proxy- and Command Mediator-Design
Patterns.
The picture below shows the architecture. In this case the UI is connected to a controller component mediated via
the help of the Remotecontrol ComponentOCX. The controller component is configured component which can
run even in generic Container executable. The controller could then connect to a model component(s) and deal
with the proxies and returns as well as AT event channels bound to these models. Each of these components are
allowed to run all within individual containers or grouped altogether and running within a single container. This
means, that the execution architecture is totally configurable and not fixed at configuration but configurable even
at runtime.
US 2002/O124054A1 Sep. 5, 2002
Command
Controller FSM Object (Atomic)
Component loi is Atolnic events
Command
Model (Service) Object (Atomic)
Component
Atomic events
US 2002/O124054 A1 Sep. 5, 2002
These are the general steps when a User Interface Component participates on the ATOMIC
Event communication subsystem:
1. User Interface code makes a request for information via the OLE method interface on
the RemotecontrolComponentOCX to initialize dispatching subsystem (only when it is
not running within a CapGM GenericMain executable, e.g. in 3-rd-party executable).
2. User Interface code makes a request for information via the OLE method interface on
the Remote(ControlComponentOCX to create an event channel with a stringified
pattern (see ATOMIC standard).
3. The logic in the RemotecontrolcomponentOCX determines using an Event Mediator
that creates an ATOMIC event channel.
4. The thread of control in the Remotecontrol ComponentOCX returns to the User
Interface code.
5. User Interface code makes a request for information via the OLE method interface on
the RemoteControlComponentOCX to send an event to a previously created channel
via Supplying a stringified event.
6. Whenever the EventMediator within the Remotecontrol ComponentOCX logic
receives an event belonging to the same stringified channel pattern it sends an OLE
event to the User Interface code indicating that an ATOMIC event has arrived.
The following chapter offers a detailed description of the OLE Automation interface the
RemotecontrolComponentOCX provides as API to the user. Additionally the backend
consumer API will be explained. As the picture above is showing, the Asynchron
Communication Component consists of two parts, a frontend part (the
US 2002/O124054A1 Sep. 5, 2002
void packReturnevent (boolean mode) Get all the internally queued key
value pairs of the return and pack
them into one string, which gets then
delivered via the ReturnBventiata
Event to the user. This could be
helpful on environments which
cannot callback into the
RemotecontrolComponentOCX
within the event firing method.
boolean initATEvtChan (BSTR ChanName) In addition to the inbuild oneway AT- D
event channel of the CM, there can be
additional arbitrary AT event
channels be created. This call is
forwarded to the EventMediator
which does manage these channels.
You should specify the string you
want inclusive delimiters for
hierarchies etc. There is no
application or modality pattern added
internally.
boolean exitATEvtChan (BSTR ChanName) Refere the channel you want to be D
destroyed.
void QueueATEvtChan (BSTR ChanName, BSTR qup, long Does queue up the incomming AT C
anz) events internally until a number of
anz events. All events not consumed
when a overrun occurs are lost.
BSTR WaitAtEvtChan (BSTR ChanName) Get the next AT event from the queue C
with the specified AT channel
pattern. The pattern is not bound to a
component pointer internally. This
cal does not block. It is intended for
environments that are not able to
receive events. In this case AT event
queueing typically has been switched
O
US 2002/O124054A1 Sep. 5, 2002
12
boolean sndAtEvtChan (BSTR ChanName, BSTR evt) Send the event-string evt to the
channel ChanName
boolean cancelCmdld (BSTRs.ID, BSTR cID) Cancel a command in channel sid All modes
with the commandid cid. The
backend has react with a call to
isTerminatedO
BSTR executeEx (BSTRsID) Execute a command in channel sid in All modes
async callback mode. The command
id cid is returned.
BSTR executeModeEx (BSTR sID, BSTR mode) Execute a command in channel sid in All modes
a specified mode. The commandid
cid is returned.
CALLBACK MODE,
FUTURE MODE or
ONEWAY MODE are allowed
boolean suspendCmdId (BSTRsID, BSTR cID) Suspend a command in channel sid All modes
with the command id cid. The
backend has react with a call to
isPause(true)
boolean resumeCmdId (BSTR sID, BSTR cID) Resume a command in channel sid All modes
with the command id cid. The
backend has react with a call to
isPause(false)
boolean continuecmdid (BSTR sID, BSTR cID, BSTR res) Continue a command in channel sid All modes
with the commandid cid and hand
out a user result res. The backend has
called co->suspendO previously to
ask the user for more information
(e.g. long running job is missing
retrun object.
void UpdateEvent (BSTR sID, BSTRsMessage) This automation event gets raised
when the backend does send an AT
event on the in-build EventChannel
void Return EventBata (BSTRsID, BSTRsMessage) OLE-Event which gets delivered,
when a return arrives, but in contrast
to the FireReturnEvent all the key
value pairs are contained in the data
string. For the seperation tokens used
within the data string please refer to
the packReturnvent method
void ATEvtChan (BSTR ChanName, BSTR evt) This automation event gets raised
when on one of your own registered
AT channels an At event is received.
The event does deliver the naen of
the channel and the event string
US 2002/O124054A1 Sep. 5, 2002
14
FOOOOOOSOOO8.
<head>
<body onload="Calc Onload ()" onunload="Calc. On Jnload ()" background =
"E: \Src\calcasp5V calcasp5 Local Vimages\Syngo. ppt background.jpg">
Afterwards a very thin UI part is following in HTML as well.
&HRs
<pa <FONT color=redd <STRONG >WebBrowser Enableded Asynchron 1 : 1
Client/Server Communication Patterna/STRONGc z/FONT> <Ap>
<ps <input name="Text 1" size="9" value="3" >
<input type="button" value="Add" name="Add" on click="Add Click ()"
></p>
<ps (input name="Text2" size="9" value="2" >
</p>
US 2002/O124054A1 Sep. 5, 2002
15
The RemotecontrolComponentOCX has to be embedded on a HTML page via the object tag
as shown below ...
The RemotecontrolComponentOCX fires OLE events which can be sinked on the HTML
page as shown below ...
Other unimportant GUIHTML primitives (like object tags with a lot of params) are ignored
for now, but the action handlers finally activated by these UI items are shown within some
script code below ...
<SCRIPT LANGUAGE = "JavaScript">
var sSid
var key
War wall
var key1
var val1
Var reto
War X.
As soon as the backend talks to the frontend, the RemotecontrolComponentOCX fires OLE
Automation events which will be forwarded to the two methods below (see also the object tag
above).
function return Event (ID)
Remote control ComponentOCX1 Return Event ( ID )
When any component fires an AT event to a channel we pattern we used as Well, the OLE
Automation event below is fired.
War retb
War ?ets
War
calc. ProgressBar1. Min = 0
calc. ProgressBarl. Max = 100
calc. ProgressBari. Value = 0
document. Remote Control ComponentOCX1. initDispatch (" ")
ssid =
document. Remotecontrol ComponentOCX1. loadCommand Mediator ("CKeyValueCM
)
retb = document. Remote Control ComponentOCX1. set ChannelName (ssid,
"VVKeyValueProxy VVMEDCOM1 \\ S.")
rets = document. Remotecontrol ComponentOCX1. callProxy Method (ssid,
"SetNameTag", "WWKeyValueProxy\\MEDCOM1\\S")
retb =
document. Remotecontrol ComponentOCX1. initATEvtChan (document. calc. send
ChanTxt. value) ;
Calc. Text 1. value = 4"
Calc. Text 2. Value = "9"
Calc. Text3. Value = " '
The sequence of these three commands can be called more than once and for every call a new
internal channel gets created. The parameter for loadCommandMediator should be always
*CKeyValueCM’ for now. The parameters of the other two methods should be different for all
individual channels but it should have the same value string for setChannelName and
callProXyMethod of a given channel SSid. Only this guarantees that the update event channel
(1:n) which can be triggered on server site correlates exactly with the command channel (1:1).
In the Xample below this name is"MEDCOM MOD" which creates both, an event and a
command channel only for the local machine. If a channel should be created for distributed
machines, the string pattern should be constructed according to a network pattern (take a look
into the AT user's guide for more information on creating AT local or network patterns. For
instance, if instead of "MEDCOM MOD" a different pattern, like "\MEDCOM MOD\S"
would have been used as parameter for both APIs, the communication would be possible even
across machine boundaries. Another precondition is that now on both machines the NPS
deamon has to be running. The NPS deamon itself is an software IC compliant backend
component which can be started with a CsaGenericMain backend container. An example
configuration file for the NPS deamon is shown below.
i ==============================================
# Example configuration file for the NPS daemon.
# =================s============================
# The daemon supports the following options:
# - d <Domain Name> : The logical domain name in which the NPS daemon is
located
# -j <joined Domains : Additional domain to which the NPS daemon is to be
joined
# - c <Cycle time> : Time in seconds between each broadcast the daemon makes
to
establish and keep contact to the other NPS daemons.
(default 60s)
US 2002/O124054A1 Sep. 5, 2002
18
Keep in mind, that the backend site of the Remotecontrol ComponentOCX, the KeyValueCO
consumer class which runs typically in a CsaGenericComponent, uses the same string as
parameter in the Consumer initialize method and as the fifth parameter of the KeyValueCO
CommandObject's create method. This is necessary, otherwise the communication endpoints
would not be connected properly (see below).
myKeyValueCO = CKeyValueCO: : create ( (const chair
*) 0, true, CapAtcmdNoWBox Ta, (void *) O, "WWKeyValueProxy \\MEDCOM1 \\S");
// command channel
myKeyValueCO->initialize (this, "VVKeyValueProxyWWMEDCOM1\\S") ; // update
event channel
The same command can be exuted also in future mode, where a wait call is used to reSync to a
previously activated command.
This has the same effect as a synchronous activation...
function. Add Click ()
calc. Text3. Value = ""
document. Remotecontrol ComponentOCX1. proxy ClearKeyValue List (ssid)
key = "cmd."
wall = ''Add'
document. Remote control ComponentOCX1. proxyAdd KeyValue (ssid, key, vall)
key = "sumA"
val = calc. Text 1. value
document. Remotecontrol ComponentOCX1.proxyAdd KeyValue (ssid, key, val)
key = "sumB"
val. = Calc. Text 2. value
document. Remotecontrol ComponentOCX1.proxyAddKeyValue (ssid, key, val)
val = document. Remotecontrol ComponentOCX1. executeModeEx
(ssid, "FUTURE MODE")
if (val = "C")
{
AddOueued Result ("", vall)
}
for (i = 0; i <10; i++)
rval1 = document. Remotecontrol ComponentOCX1. WaitCmdId (ssid,
calc. Combo 1. value, -1)
}
As we have seen above, a commandid that came back as a result of an execute method can be
stored anywhere in the frontend and later on used to cancel, suspend, resume or continue a
running job via the command id. A situation where cancel, suspend and resume are is used is
shown below. ...
US 2002/0124054 A1 Sep. 5, 2002
20
Whenever a job has been executed or canceled, all these are asynchronous calls typically, the
results will came back from the backend some times later and will be delivered to the UI via
an OLE event fired by the RemoteControlComponentOCX, as shown below. The first
example shows an OLE Automation event called when a subscribed AT event channel has a
new value to deliver.
The Second example shows an OLE Automation event called when command has a new reply
result value to deliver.
function Remotecontrol ComponentOCX1 Return Event (sID )
{
document. Remotecontrol ComponentOCX1.setCurrentCommand Mediator (sID)
document. Remotecontrol ComponentOCX1. return SetKeyValueToFirst (sID)
retb = document. Remotecontrol ComponentOCX1. returnGetNextKeyValue (SID)
key = document. Remotecontrol ComponentOCX1. returndet Current Key (sID)
val = document. Remotecontrol ComponentOCX1. returnCetCurrentValue (SID)
if ( (key == "reply") &&. (val == "Add") )
US 2002/O124054 A1 Sep. 5, 2002
21
retb =
document. Remotecontrol ComponentOCX1. returngetNextKeyValue (SID)
key = document. Remotecontrol ComponentOCX1. returnGetCurrentKey (sID)
Val =
document. Remotecontrol ComponentOCX1. returngetCurrentValue (SID)
if (key == "cooky")
AddOueued Result ("", vall)
}
if (key == "percent")
{
retio =
document. Remotecontrol ComponentOCX1 . . returngetNextkeyValue (SID)
key 1 =
document. Remotecontrol ComponentOCX1. returnGetCurrentKey (SID)
Vali =
document. Remotecontrol ComponentOCX1 . . returnGetCurrentValue (sID)
AddMoreResult (val, val1)
}
if (key == "NewState")
retb =
document. Remotecontrol ComponentOCX1 . returngetNext KeyValue (SID)
key1 =
document. Remote Control ComponentOCX1 . returngetCurrentkey (SID)
Val1 =
document. Remotecontrol ComponentOCX1 . returnGetCurrentValue (sID)
AddMoreResult (val val1)
if (key == "result")
reto -
document. Remote Control ComponentOCX1. returngetNextkeyValue (sID)
key1 =
document. Remotecontrol ComponentOCX1 .returngetcurrentKey (SID)
Wall =
document. Remotecontrol ComponentOCX1 . . returngetCurrentValue (SID)
AddEnd Result (val val1)
}
These events can indicate different reply situations as sent by the backend. The example below
shows an event, the example backend called, to indicate that it queued the request but did not
process it, finally. ...
The next function shows a situation where the backend indicates some progress while it is
currently executing a request.....
function AddMoreResult (res , cooky )
{
// not the last reply! More are expected later on!
if (res == "suspended")
{
calc. Text3. value "suspended, press Resume . . . "
calc. Combo 1. value = cooky // select first member in list
return;
}
if (res == "resumed")
{
calc. Text3. value = "Add Cmd resumed."
return;
}
if (res == "delayed")
{
var theResponse
calc. Text3. value = "cmd delayed . . . "
theResponse = "10"
theResponse = window. prompt ("Suml is O ! Please enter a new
value greater O !", the Response) ;
calc. Text 1. value = theResponse
if (calc. Combo1. value = "")
retb = document. Remotecontrol ComponentOCX1. continuecmdId (ssid,
calc. Combo1. Text, theResponse)
return;
if (res == "continued")
{
war result;
calc. Text3. value = "Add cmd continued!"
return;
f / more replies expected, adjust progressbar
Calc. ProgressBari. Value = res
calc. Text3. Value = ""
The last function shows a situation where the backend indicates the end result of a request it
has performed completely... ...
function AddEnd Result (res , cooky)
// rem last one, no more replies expected, adjust progressbar
War x
Calic. Text3. value = res
calc. ProgressBar1. Value = 0
if (calc. Combo.1. List Count > = 1)
for ( x = 1 ; x <= calc. Combo 1. List Count ; x++ )
US 2002/O124054 A1 Sep. 5, 2002
23
The backend could come into idle time situations, where no client has a request running, but
the backend could detects a situation where it needs to inform the clients. For this reason, it
has to send an event via an update channel, which will be received by the
RemoteControlComponentOCX. The RemotecontrolComponentOCX fires an OLE Event
which can be sinked, as shown below...
War rets
var retb
// shutdown gracefully when things are yet running
for ( X = 0 , x < call C. Combol. List Count : x++ )
// first destroy the local return object
rval1 = document. Remotecontroli ComponentOCX1. Destroy CmdId (ssid,
calc. Combo.1. List (x))
// Second stop the running Commands in BE -> Since return are dead,
no replies will come.
rval1 = document. Remotecontrol ComponentOCX1. cancelCmdId (ssid,
calc. Combo.1. List (x))
rets document. Remotecontrol ComponentOCX1. unloadCommand Mediator (SSid)
reto
document. Remotecontrol ComponentOCX1. exitATEvtChan (document. calc. send
ChanTxt. value);
document. Remote control ComponentOCX1. exitDispatch ()
</SCRIPTs
</body>
</html>
US 2002/0124054 A1 Sep. 5, 2002
25
The sample used for all examples is the Calc Application described in more detail after a short review the
application design.
The example Calc Application used for this purpose should simulate a calculator which uses a frontend and a
backend for adding two numbers and presenting the result. The application allows to demonstrate most critical
parts of an asynchronous communication environment, reaching from non-blocking GUIs over multiple replies to
indicate progress, to flow control events indicating that the backend needs some rest to follow all the requests
queued for the asynchronously running frontends
The sample demonstrates these essential communication aspects:
Asynchronous, non-blocking activation request.
None, one or multiple replies as a result to a single request.
Cancellation of running requests.
Flow control when backend request queue reached a high-water-mark
Fire asynchronous events in to indicate flow control limits.
Suspend a running backend job.
Resume a running backend job.
Continue a delayed backend job.
The figure below shows an example application View GUI component (MacroOCX) and how it accesses its
controller FSM component via the proxy and return objects, which are based on ATOMIC standard internally.
The according model or services component (backend), called calcbe, and command object projects (testcmd
prox/ret and testcmd-cmd) are shown at the end of this paper.
The picture below shows what features the Remotecontrol ComponentOCX addresses in form
of a Design Pattern.
US 2002/O124054A1 Sep. 5, 2002
26
he Calc App
simple asynchron Web Application Example
joint:53:5.
US 2002/O124054A1 Sep. 5, 2002
27
FFOOOOO1 tacBOOOO3O3S
A/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
W/ The interesting part of the MacroOCX cntrl class
US 2002/O124054A1 Sep. 5, 2002
28
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#include <AT/CapFxtRep.h>
Class CCalcctlfecppDlg;
class CCalcctlfecppCtrl : public CapMacroOCXBase
DECLARE DYNCREATE (CCalcctlfecppCtrl)
// Constructor
public:
CCalcctlfecppCtrl ();
// Overrides
// Class Wizard generated virtual function overrides
//{{AFX VIRTUAL (CCalcctlfecppCtrl)
public:
virtual void OnDraw (CDC* pdic, const CRect & rocBounds,
const CRect & rocInvalid);
virtual void DoPropBExchange (CPropExchange pPX) ;
virtual void OnReset State () ;
// AFX VIRTUAL
// Implementation
protected:
afx msg. BSTR GetName (LPCTSTR tokenld);
~ CCalcctlfecppCtrl () ;
// Message maps
//{{AFX MSG (CCalcctlfecppCtrl)
afx msg. int. OnCreate (IPCREATESTRUCT lpCreateStruct) ;
afx msg. void OnSize (UINT nType, int Cx, int cy);
afx msg. void OnDestroy () ;
afx msg. void OnClose () ;
//}}AFX MSG
US 2002/O124054A1 Sep. 5, 2002
29
CCalcctlfecppCtrl : : - CCalcctlfecppCtrl ()
// TODO: Cleanup your control's instance data here.
if (m Calcctlfecpp. microdlig) delete
m Calcctlfecpp. microdlig;
m Calcctlfecpp. microdlg. = NULL;
//AfxMessageBox (T("s"));
m CalcCtlifeCpp IniCrOdlg-> Stop () ;
m CalcCtlifeCpp microdlig->Destroy Window () ;
delete m Calcctlfecpp microdlig;
m Calcctlfecpp. microdlig = NULL;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// dispatching subsystem for 3-ro-party executables Only
void CCalcctlfecppCtrl :: exitDispatch ()
{
// TODO: Add your dispatch handler code here
In CalcCtlifecpp. microdilig- >eDisp () ;
void CCalcctlfecppCtrl :: initDispatch (LPCTSTR Svcfile)
// TODO: Add your dispatch handler code here
CString sf = T ("");
sf=svcfile;
m Calcctlfecpp microdlig- >iDisp (Sf);
?/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// The dialog Class
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class CCalcCtlifecppDl g : public CDialog
{
// Construction
public :
CCalcctlfecppDig (CWind pParent = NULL); // standard
COnStruct Or
~ CCalcct fecppDlg () ;
void stop () ;
void start () ;
void iDisp (CString & finam) ;
void eDisp () ;
// Add cmd. Return event reaction handlers
void AddEnd Result (CString &res, CString &cooky) ;
void Add MoreResult (CString &res, CString & Cooky);
void AddOueued Result (CString &res, CString &cmdid);
// Add cmd. Update event reaction handlers
void AddSuspend ();
Void AddResume () ;
US 2002/O124054A1 Sep. 5, 2002
32
// Dialog Data
//{{AFX DATA (CCalcctlfecppDlg)
enum ( IDD = IDD DIALOG CALCCTLFECPP };
CEdit m chan;
CEdit m esnd;
CEdit mercv;
CComboBox m combol;
CEdit ma;
CEdit mb;
CEdit mo;
CRemotecontrol ComponentOCX m it focx;
//}}AFX DATA
// Overrides
// ClassWizard generated virtual function overrides
//{ (AFX VIRTUAL (CCalcctlfecppDlg)
protected:
virtual void DoDataFXchange (CDataExchange pDX); //
DDX/DDV support
//}}AFX VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX MSG (CCalcctlfecppDlg)
afx msg. void
OnReturn EventRemotecontrol ComponentOCXctrl.1 (LPCTSTR
sID) ;
afx msg. void
OnUpdateEventRemotecontrol ComponentOCXctrl.1 (LPCTSTR
SID, LPCTSTR sMessage) ;
afx msg. void
OnReturn EventDataRemotecontrol ComponentOCXctrl.1 (LPCTSTR
SID, LPCTSTR sMessage) ;
afx msg. void
On ATEvt Chan.Remotecontrol ComponentOCXctrl.1 (LPCTSTR
ChanName, LPCTSTR evt) ;
virtual BOOL OnlinitDialog () ;
afx msg. void OnCancel ();
afx. Insg void. On Add ();
US 2002/O124054A1 Sep. 5, 2002
33
CCalcCtlifecppDlg: : -CCalcCtlifecppDlg ()
{
}
void CCalcctlfecppDlg::DoDataExchange (CDataExchange pDX)
{
CDialog: : DoDataExchange (pDX) ;
//{{AFX DATA MAP (CCalcctlfecppDlg)
DDX Control (pDX, IDC CHANNEL, m chan) ;
DDX Control (pDX, IDC EVENT SND, mesnd);
DDX Control (pDX, IDC EVENT RCV, mercv);
DDX Control (pDX, IDC COMBO1, m. combo1);
DDX Control (pDX, IDC EA, ma) ;
DDX Control (pDX, IDC EB, mb) ;
DDX Control (pDX, IDC EC, mc) ;
DDX Control (pDX, IDC REMOTECONTROLCOMPONENTOCXCTRL1,
m it focx) ;
// AFX DATA MAP
ON EVENT (CCalcctlfecppDlg,
IDC REMOTECONTROLCOMPONENTOCXCTRL1, 3 /*
Return EventData */
OnReturn EventDataRemotecontrol ComponentOCXctrll,
VTS BSTR VTS BSTR)
ON EVENT (CCalcctlfecppDlg,
DC REMOTECONTROLCOMPONENTOCXCTRL1, 4 /* ATEvt Chan */,
OnATEvt Chan.Remotecontrol ComponentOCXctrl 1, VTS BSTR
VTS BSTR)
//}}AFX EVENTSINK MAP
END EVENTSINK MAP ()
//- - - - - - - - - RemoteControl ComponentOCX OLE Events - - - - - - - - - -
Void
CCalcctlfecppDlg: : OnReturn Event Remotecontrol ComponentOC
Xctrl.1 (LPCTSTR sid)
CString
val1=m it focx. returngetCurrentValue (Sid);
Add MoreResult (val, Val1) ;
return;
void
CCalcCtlifecppDlg: : OnupdateEventRetnotecontrol ComponentOC
Xctrl.1 (LPCTSTR sid, LPCTSTR smessage)
// TODO : Add your control notification handler code
here
// handles update events for the command channel (only
receivable for Remote control ComponentOCX)
// here used for flow control events from the business
Components request queue.
In it focX. SetCurrentCommand Mediator (Sid) ;
CString msg=sMessage;
if (msg==AddNotifyXoff) AddSuspend () ;
if (msg==AddNotifyxon) AddResume () ;
US 2002/O124054A1 Sep. 5, 2002
37
void
CCalcctlfecppDlg: : OnReturn EventDataRemotecontrol Compone
intoCXCtrl.1 (LPCTSTR sID, LPCTSTR sMessage)
// TODO : Add your control notification handler code
here
// handles all (multiple) replys of commands and has
all data packed in
// just a single string even if there are multiple
key/vals
// This is for poor environments like java or asp
Void
CCalcCtlifecppDlg: : On ATEvtChan Remotecontrol ComponentOCXc
tril1 (LPCTSTR ChanName, LPCTSTR evt)
// TODO : Add your control notification handler code
here
// handles AT event channel events that has been
created vis the
// Remotecontrol ComponentOCX before.
this->m ercv. SetWindowText (evt) ;
A/- - - -
void CCalcctlfecppDlg: : start ()
//AfxMessageBox ( T ("start"));
ssid = m it focx. loadCommand Mediator ( T ("CKeyValueCM"));
// Create a new event propagation channel for
especially for this Cmd channel
BOOL ret =
m it focx. SetChannelName (ssid, T ("MEDCOM MOD"));
// Set the name tag method of the one and only c/s
PrOXy of this channel
CString rets =
m it focx. callProxy!Method (ssid, T ("SetNameTag"), T ("\\Ke
yValueProxy VVMEDCOM1 \\SOD")) ;
CString chan;
this->m chan. GetWindowText (chan) ;
ret=m it focx. initaTEvt Chan (chan) ;
initiated = true;
US 2002/O124054A1 Sep. 5, 2002
38
key= ( T ("Cmd"));
vall= ( T ("Add"));
m it focx.proxyAdd KeyValue (ssid, key, vall) ;
key= ( T ("sumA"));
this->ma. GetWindowText (val) ;
m it focx.proxyAdd KeyValue (ssid, key, vall) ;
key= ( T ("sumB"));
this->mb. GetWindowText (val) ;
In it focx.proxyAdd KeyValue (ssid, key, vall) ;
CString cmdid= T (" ") ;
CString v = T (" ") ;
cmdid =
m itfocx. executeModeEx{ssid, T ("CALLBACK MODE"));
//AfxMessageBox (cmdid);
if (cmdid== T ("C") || cmdid== T (" ") )
{
// do not add the cmdid here, it is wrong for a
controller
// and the right one will come later via a separate
reply
}
else
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Void CCalcCtlifecppDlg: : AddOueued Result (CString &res, CString
&cmdid)
{
this->mc. SetWindowText (res) ;
m combo.1. AddString (cmdid);
if (m combo1. Get Count () == 1)
{
m combo1. Select String (-1, cmdid);
}
if (res== T ("resumed") )
this->mc. SetWindowText ( T ("Add cmd resumed"));
this->UpdateData (FALSE) ;
this->Show.Window (SW SHOWNA);
return;
if (res== T ("delayed"))
m combo 1. SetCurSell (O); // select first member in
list
this->mc. SetWindowText ( T ("delayed . . . "));
this->UpdateData (FALSE) ;
this-> ShowWindow (SW SHOWNA);
//AfxMessageBox ( T ("Add Command asks a question:
stop (yes/no) 2"));
edidiag mydiag;
US 2002/O124054A1 Sep. 5, 2002
42
Imydiag. DOModal () ;
CString result = T ("10") ;
result = mydiag. m res. m txt;
CString val;
this->ma. SetWindowText (result) ;
m combo.1. SetCurSell (O); // select first member in
list
In combO1. GetLBText (m Combo1. GetCurSel (), vall) ;
if (val = T (" ") )
BOOL ret=In it focx. ContinuecmdId (ssid,
val, result) ;
if (! ret)
{ // error, not the right proxy and/or no
controllier
}
return;
if (res== T ("continued") )
this->mc. SetWindowText ( T ("Add cmd continued"));
this->UpdateData (FALSE) ;
this->Show Window (SW SHOWNA) ;
return;
int progress;
chair txt 200;
CSA CSTRING TO ASCII (res, &txt Ol) ;
SScanif (txt, "%d", &progress);
this - >m WindProgress Ctrl = (CProgressBar *) this
>GetDlgItem (IDC PROGCTRL1);
this - >m WindProgress Ctrl->SetValue ( (float) progress);
this >mc. SetWindowText ( T (" "));
this - > UpdateData (FALSE) ;
this - > Show Window (SW SHOWNA) ;
void CCalcctlfecppDlg::AddSuspend ()
this->m add = (CButton *) this->GetDlgItem (IDC ADD) ;
this->m add-> Show Window (SW HIDE) ;
Private Sub AddOueued Result (ByVal res. As String, ByVal cmdid. As String)
TeX t3. Text es
Combol. Addltem (cmdid)
(Combo.1. List Count 1) Then
Combo 1. Text Cmdid
US 2002/O124054A1 Sep. 5, 2002
47
End. If
End Sub
Private Sub AddEnd Result (ByVal res. As String, ByVal cooky As String)
'last One, no more replies expected, adjust progressbar
Dim x. As Integer
Text3. Text = res
Progress Bar1. Value = 0
If (Combol. List Count > = 1.) Then
For X = 1 To Combo1. List Count
If (Combol. List (x - 1) = cooky) Then
Combol. Remove Item (x - 1)
If (Combol. List Count > = 1.) Then
Combo.1. Text = Combo.1. List (O)
Else
Combo. Text =
End if
End. If
Next
End. If
End Sub
US 2002/0124054A1 Sep. 5, 2002
48
End Sub
End Sub
1.6.1.3 View Component with Remotecontrol ComponentOCX - Example: frontend part on HTML
Page running in CapGM GUI container generic executable
<head>
US 2002/0124054 A1 Sep. 5, 2002
50
<title>Calc CalcCapGM-HTMLC/title>
</head>
<body onload="Calc Onload ()" onunload="Calc Onunload ()" background =
"E: \src\calcasp5\calcasp5 Local \images\Syngo. ppt background.jpg">
<!-- //============================================================== -->
<!-- //- - - - - - - - - - Very Thin GUI for the calc application-->
< -- //============================================================== -->
<form method="post" action-" - -WEBBOT-SELF-- " name=" calc" >
<!-- webbot bot="SaveResults" U-File="fpweb :/// private/form results.txt."
S-Format="TEXT / CSV" S-Label-Fields - "TRUE." -->
<HRs
<ps <FONT color= redd <STRONG:-Web-CapGM Enableded Asynchron 1 : 1
Client/Server Communication Patternz /STRONG ></FONT></p>
<p <input name="Text 1" size="9" value="3" >
<input type="button" value="Add" name="Add" onclick="Add Click () "
></p>
<pa <input name="Text 2" size="9" value="2" >
<OBJECT classid=clsid: 35053A22-8589-11D1-B16A- OOCOFO283628 height=15
id=ProgressBarl width=70>
<PARAM NAME=" ExtentX" VALUE="1588 ">
<PARAM NAME="Extent Y." VALUE="397">
<PARAM NAME=" Version" VALUE="393216">
<PARAM NAME="BorderStyle" VALUE="0">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="Enabled." VALUE="1">
<PARAM NAME="OLEDropMode" VALUE="O">
<PARAM NAME = "Min" VALUE="O">
(PARAM NAME = 'Max VALUE-100">
<PARAM NAME="Orientation" VALUE="0">
<PARAM NAME="Scrolling" VALUE="0">
</OBJECTs
</p>
<pa <input name="Text3" size="9" >
<input type="button" value="Cancel" name="Cancel."
onclick="Cancel Click () " >
<input type="button" value="Suspend" name="Suspend"
onclick="Suspend Click ()" >
<input type= "button" value="Resume" name="Suspend"
</p> onclick="Resume Click () " >
<pa
<OBJECT classid=clsid: 8BD21D3 O-EC42-11CE-9EOD-OOAAOO 6002 F3 height=24
id= Combol
width=169>
<PARAM NAME="VariousPropertyBits" VALUE="7466 04571">
<PARAM NAME- "BackColor" VALUE="2147483.653">
<PARAM NAME="ForeColor" VALUE="2147483.656">
<PARAM NAME="MaxLength." VALUE="0">
<PARAM NAME="BorderStyle" VALUE="O">
<PARAM NAME="ScrollBars VALUE-O is
<PARAM NAME="DisplayStyle" VALUE="3">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="Size" VALUE="3413 ; 635">
US 2002/0124054 A1 Sep. 5, 2002
51
</forma
k --//============================================================== -->
<!-- //- - - - - - - - - - Remotecontrol ComponentOCX Ole Event Handler declaration --
>
<SCRIPT LANGUAGE="JavaScript">
//=====================================================================
//- - - - - - - - - - GUI Adapter to Web Business Logic via Scripting Language
//=====================================================================
var sSid
var key
var val
var key1
war wall
var retb
Val X
//=====================================================================
A/- - - - - - - - - - GUI Adapter for single command activation
A/=====================================================================
function Add Click ()
{
f/rem. Add
//window. alert ( navigator. appName );
calc. Text3 - value = ""
document. Remotecontrol ComponentOCX1.proxyClearKeyValueList (ssid)
key = "cmd."
val. s "Add."
document. Remote Control ComponentOCX1.proxyAdd KeyValue (ssid, key, vali)
key = "sumA"
val = calc. Text 1. value
document. Remote Control ComponentOCXl.proxyAddKeyValue (ssid, key, val)
key = "sumB"
vali = catc. Text2 . . value
document. Remotecontrol ComponentOCX1.proxyAdd KeyValue (ssid, key, val)
f / document. Remotecontrol ComponentOCX1. execute (ssid)
val = document. Remotecontrol ComponentOCX1. executeModeFX
(ssid, "CALLBACK MODE")
if (val - "C")
US 2002/O124054A1 Sep. 5, 2002
53
//=====================================================================
//- - - - - - - - - - GUI Adapter for event propagation
A/=====================================================================
function SendChanEvt Click ()
// send AT event evt to AT channel chan
document. Remotecontrol ComponentOCX1. SindAtEvt Chan
(document. calc. sendChanTxt. value, document. call C. send EvtTXt. value) ;
}
//=====================================================================
//- - - - - - - - - - Remotecontrol ComponentOCX Ole Event handlers
//=====================================================================
function return Event (ID)
{
Remotecontrol ComponentOCX1 ReturnEvent ( ID )
}
function updateEvent (ID, Sparam)
US 2002/O124054 A1 Sep. 5, 2002
54
retb =
document. Remotecontrol ComponentOCX1. returnGetNextKeyValue (SID)
key1 =
document. Remotecontrol ComponentOCX1. returngetCurrentKey (sID)
Val1 =
document. Remotecontrol ComponentOCX1. returngetCurrentValue (sID)
AddEnd Result (val, vall)
//=====================================================================
// - - - - - - - - - - GUI Adapter for single command callbacks
// =====================================================================
function AddOueued Result (res, cmdid )
calc. Text3. Value = res
calc. Combol. Additem (Cmdid)
if (calc. Combo 1. List Count == 1)
{
calc. Combol. value = cmdid
}
}
function AddMoreResult (res , cooky )
{
if (res == "suspended")
{
calc. Text3. value = "suspended, press Resume . . . "
calc. Combol. value = cooky // select first member in list
return;
}
if (res == "resumed")
{
calc. Text3. value = "Add cmd resumed."
return;
}
if (res == "delayed")
var theResponse
calc. Text3. value = "cmd delayed . . . "
theResponse = "10"
US 2002/O124054A1 Sep. 5, 2002
56
if (res == "continued")
var result;
calc. Text3. value = "Add cnd continued!"
return;
function. AddSuspend ()
calc. Add. disabled = true
}
function. AddResume ()
{
calc. Add. disabled = false
}
//=====================================================================
f/- - - - - - - - - - Init / Exit Handlers
US 2002/O124054A1 Sep. 5, 2002
57
war rets
var retb
rets = document. Remotecontrol ComponentOCX1. unloadCommand Mediator (ssid)
retb =
document. Remotecontrol ComponentOCX1. exitATEvtChan (document. calc. Send
ChanTxt. value) ;
f/document. Remotecontrol ComponentOCX1. exitDispatch ()
</SCRIPTs
</body>
</html>
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// The Controller MacroOCX Ctrl class
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// the MacroOCX header file ...
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// CalcctCtl.h:
// Declaration of the CCalcict Ctrl ActiveX Control class.
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / //
// CCalcctCtrl : See CalcctCtl.cpp for implementation.
# include "stdafx. h."
#include <AT/CapExtRep.h>
// ACE Guard
#include <ace/Synch.h>
//cmd
#include <At/CapAtCmdObjBase.h>
Class p1;
class r1;
class con1;
A / ifock
class mycon;
class CKeyValueReturn;
// running object map of upper layer and lower layer proxy/ret requests
class roe : public CObject
public:
CString cmdidu;
CapAtCmdIdType idu;
CKeyValueReturn *ru;
// Operations
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// Dispatch map
BEGIN DISPATCH MAP (CCalcctCtrl, CapMacrooCXBase)
//{{AFX. DISPATCH MAP (CCalcctCtrl)
// NOTE - Class Wizard will add and remove dispatch map entries
?/ DO NOT EDIT what you see in these blocks of generated code !
DISP STOCKPROP FONT ()
US 2002/O124054A1 Sep. 5, 2002
62
///////// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// Event map
BEGIN EVENT MAP (CCalcct Ctrl, CapMacroOCXBase)
//{{AFX EVENT MAP (CCalcctCtrl)
f / NOTE - Class Wizard will add and remove event map entries
// DO NOT EDIT what you see in these blocks of generated code
//}}AFX EVENT MAP
END EVENT MAP ()
/ / / / / / / / / / // // / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / // / / // / / / / / // / / / // / / /
A / Property pages
// TODO: Add more property pages as needed. Remember to increase the
COunt
BEGIN PROPPAGEIDS (CCalcctCtrl, 1)
PROPPAGEID (CCalcctPropPage : : guid)
END PROPPAGETDS (CCalcictotrl)
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
A / Initialize class factory and guid
IMPLEMENT OLECREATE EX (CCalcctctrl, "CALCCT. CalcctCtrl.1",
0x318b7 da7, Ox8213, Ox46cb, 0x83, Ox74, Oxc5, Ox64, Ox60, Oxal,
Oxla, OX4b)
W// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// Type library ID and version
IMPLEMENT OLETYPELIB (CCalcctotrl, tiid, wVerMajor, wVerMinor)
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// Interface IDs
Const IID BASED CODE IID DCalcct =
{ OX318b7 da5 OX8213, Ox46cb, { OX83, OX74, OXC5, 0x64 0x60
Oxall, OX1a, Ox4b } };
COISt TD BASED CODE IID DCaCC tEvents
{ 0x318b7da6, Ox8213, Ox46cb, { 0x83, Ox74, Oxc5, Ox64, Ox60,
Oxal, Ox1a, OX4b } };
A / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /A A/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// Control type information
Static Const DWORD BASED CODE dwCalcctoleMisc =
OLEMISC SIMPLEFRAME A / for nested controls
OLEMISC ACTIVATEWHENVISIBLE
OLEMISC SETCLIENTSITEFIRST
OLEMISC INSIDEOUT
US 2002/O124054 A1 Sep. 5, 2002
63
OLEMISC CANTLINKINSIDE
OLEMISC RECOMPOSEONRESIZE;
IMPLEMENT OLECTLTYPE (CCalcctotrl, IDS CALCCT, dwCalcctOleMisc)
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// CCalcct Ctrl : : CCalcct Ctrl - Constructor
CCalcctCtrl : ; CCalcct Ctrl ()
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
A / CCalcctCtrl: : -CCalcctCtrl - Destructor
CCalcct Ctrl : : - CCalcct Ctrl ()
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// CCalcctCtrl: ; On Draw - Drawing function
void C.Cacct Ctrl : : On Draw (
CDC's polic, const CRect& rcBounds, const CRect& rclinvalid)
A / TODO : Replace the following code with your own drawing code.
//pdc->FillRect (rcBounds,
CBrush: : FromHandle ( (HBRUSH) GetStockObject (WHITE BRUSH)));
//pdc->Ellipse (rc Bounds) ;
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// CCalcct Ctrl. : : DoPropBxchange - Persistence support
void CCalcctCtrl :: DoPropBxchange (CPropExchangek pPX)
ExchangeVersion (pPX, MAKELONG ( wVerMinor, wVerMajor));
CapMacroOCXBase : :DoPropBxchange (ppX) ;
// TODO: Call PX functions for each persistent custom property.
// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
// CCalcct Ctrl : ; OnResetState - Reset control to default state
void CCalcct Ctrl :: OnResetState ()
CapMacroOCXBase: ; OnResetState (); // Resets defaults found in
DoPropBxchange
f / TODO : Reset any other control state here.
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// please override this method
BSTR CCacct Ctrl. : : GetName (LPCTSTR token Id)
US 2002/O124054A1 Sep. 5, 2002
65
return;
}
// client return ptr vor cmdid setzen
CString retid= T ("");
retid. Format ( T("%08x &s"), (long) re->ru->getData (), re->Cmdidu) ;
if ( (ret->getMoreFlag ()) ==false)
{ // last reply
int result = ret->getC () ;
CString str result (T (""));
str result. Format (T ("%d"), result);
//my ctl->mc->AddEnd Result (str result, re->ru, re->Cmdidu);
my ctl->mc->Add End Result (str result, re->ru, retid);
re->ru-> destroy () ; A / destroy the return checked out via
keep retval
BOOL rt=myctl->rom. RemoveKey (Sid); // remove key from map
delete re; // delete running object map entry
else
{ // more replies expected, adjust progressbar
CString str ( T (" "));
//my ctl->mc->Add MoreResult (str, ret->getC () , re->ru, re->Cmdidu) ;
my ctl->mc->AddMoreResult (str, ret->getC (), re->ru, retid);
ret -> autoDestroy () ;
CapatCmdIdType id;
f / string to object conversion
bool r=this->mc->Cstr2CIndid (s , id) ;
// the proxy is reused, but the sequence id changes per execute
mp1->pause (true, &id);
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CCalcictCtrl: : Add AppEvents (LPCTSTR evt)
{
//AfxMessageBox (evt) ;
if (tcsicmp (evt, T ("xoff") ) == 0)
{
// disable add button
tac->AddSuspend () ;
}
if (tcsicmp (evt, T ("xon")) == 0)
{
// enable add button
mc->AddResume () ;
}
void CCalcictCtrl : : Add Mod Events (LPCTSTR evt)
{
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// the KeyValueCOConsumer (Remotecontrol ComponentOCX-BE) header file ...
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#ifndef mycon H
US 2002/O124054A1 Sep. 5, 2002
70
#define mycon H
A/#include <at/Csa GenericComponent.h>
mycon : : -mycon ()
int r= Stop () ;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool mycon : : start ()
{
myWBF = CsaWorkingBoxFactory : : instance (); // wb
myWBF-> create (wbid1); // wb
myKeyValueCO = CKeyValueCO: : create ( (const char
*) O, true, CapAtCmdNoWBoxId, (void k) 0, "\\ KeyValueProxy\\MEDCOM1 \\S") ;
// cmd.1 cmd
myKeyValueCO->setWBox TD (wbid1); // wb
myKeyValueCO->initialize (this, "MEDCOM MOD"); // med
this-> setKeyValueCO (my KeyValueCO); // med
// inform ACOX that I am working as a controller component not as a
business component
this->setCompType ( T ("SSSBEcontrollerBESSS"));
this->sendCOEvent (this->getCompType () ) ;
return true;
return true;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void mycon : : setCompType (const CString & msg)
compType=msg;
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void mycon : : cancel (CString & mid, CKeyValueReturnk ret)
my ctrl->AddCancel (mid, ret) ;
f /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// give the first reply back to client and hand out a sequence id
idl
ret-> clearKeyValueList ();
ret->setKeyValueToFirst () ;
ret->add KeyValue ("reply", "Add") ;
ret->add KeyValue ("cooky", idl) ;
ret->reply (true);
case -2 : // resumed
{
sprintif (txt, ("%s"), "resumed") ;
CString percent (txt);
ret->add KeyValue ("NewState", percent);
}
break;
case -3 : // delayed suspend ()
sprintf(txt, ("%s"), "delayed") ;
CString percent (txt) ;
ret->addKeyValue ("NewState", percent) ;
break;
case - 4: // continued = resume () on client called !
sprintf(txt, ("%s"), "continued");
CString percent (txt);
ret->add KeyValue ("NewState", percent);
break;
default: // running in percent of completion
sprintf(txt, ("%d"), progress);
CString percent (txt) ;
ret->add KeyValue ("percent", percent);
break;
ret->add KeyValue ("cooky", idl) ; // cmdid cooky of the lower level
Cmd!
ret->reply (true);
void mycon : : AddEnd Result (CString &res, CKeyValueReturn kret, CString idl)
ret-> clearKeyValueList () ;
ret->setKeyValueToFirst () ;
ret->addKeyValue ("reply", "Add") ;
ret->add KeyValue ("result", res);
ret->add KeyValue ("cooky", idl) ; // cmdid cooky of the lower level
cmd.
ret->reply (false) ;
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void mycon : : AddSuspend ()
{
this->sendCOEvent ("ADD xoff") ;
}
void mycon : : AddResume ()
{
this-> SendCOEvent ("ADD xon") ;
}
US 2002/O124054A1 Sep. 5, 2002
75
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool mycon: ; cmdid2Cstir (CapAt CmdIdType &id, CString & sid)
{
// CapAtCmdIdType id= mp1->getCmdId ();
unsigned long inet=id.getInlet () ;
unsigned short liport=id. getLPort () ;
unsigned long uid=id. gettjid () ;
char buf 256 :
sprintf (buf, "% 08Xi8O4xià O8x", inet, liport, ulid);
sid=buf;
return true;
1.6.3 Model (service) Component with business logic implementation (where the real calculation
takes place)
The model (business logic) component is now the lowest layer of the application model. It is
implemented as a backend component derived from CsaGenericComponent Standard (see
more in the software IC standard about this) as shown below:
f /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A / the calcbe GenericComponent header file ...
A/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#ifndef calcbe H
#define calcbe H
# include & at WCsaGenericComponent.h>
private :
//MEDSW ArT: Add private Member hear
c1 cmycmd.1; //cmds
};
iendlif
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// the calcbe GenericComponent implementation file ...
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#define ACE BUILDSVC DLL
it include cacbe. h "
calcbe : : calcbe ()
: CsaGeneric Component (this)
{
US 2002/O124054A1 Sep. 5, 2002
77
Calcbe : : - calcbe ()
{
?/MEDSW ArT : Add source code here
}
return O;
1.64 Appendix: ATOMIC based Command Proxy/Return connecting Controller to Model (service)
The controller component is using a command proxy/return interface (based on ATOMIC
standard) to a model command object implementation. Tis proxy/return dll is linked to both,
the controller component (as the client) and the model component (business logic) command
object dll (the server).
A/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// the business proxy/return object header file ...
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Testcmd prox. h.
#ifndef CAP ATCMD PROX Testcmd H
idefine CAP AT CMD PROX Testcmd H
#include <At / CapatCmdProxRetBase.h>
#include <CsaCommon/Csalefs.h>
#ifdef BUILD CapAtProxTestcmd.
#define EXP IMP CapAtProxTestcmd CSA EXPORT
fielse
#define EXP IMP CapAtProxTest cmd CSA IMPORT
iendlif
//pl BEGLN
class EXP IMP CapAtProxTestcmd p1 : public CapAtCmdProxyBase
US 2002/O124054A1 Sep. 5, 2002
80
{
DECLARE PROXY (p1)
public:
void setResult (CString & foo);
void setA (int foo= 0) ;
void setB (int foo=O);
CString getResult (void) ;
int getA (void) ;
int getB (void);
?/MEDSW ArT:
protected;
//MEDSW ArT: For all members you have corresponding Get / Set
methodes
void copyHook (const pi& class in ) ;
private :
int pvall;
int pval2;
CString res;
//MEDSW ArT: Define your data here
};
//p1 END
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// the business proxy/return object implementation file ...
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//Testcmd prox. Cpp
# include <iostream.h>
#include <At/CapAtMacDef.h>
#include "Testcmd prox. h"
f/p1 BEGIN
IMPLEMENT PROXY ( p1, G ( p val1 ) G pval2 ) C ( res) PROXY EXT )
void p1: : copyHook (const p1& C in)
CSA TRACE IN ( (CAP AT, "p1: ; copyHook"));
// the cpy hook members
pval1 = c in pval1;
pVal2 = c in .pval2;
res= c in res;
?/MEDSW ArT : Add your code here
The business logic component is finally using a command object which implements the
requested Add command which was initiated by the RemoteControl ComponentOCX running
within the corresponding UI component.
A/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
W/ the business command object header file ...
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A/Testcmd cmd.h
#ifndef CAP ATCMD CMD Testcmd H
#define CAP ATCMD CMD Testcmd H
#include <At/CapAtCmdObjBase.h>
#include <CsaCommon/CsaDefs.h>
#ifdef BUILD CapAtCmdCmdTestcmd
#define EXP IMP CapAtCmdCmdTestcmd. CSA EXPORT
else
#define EXPIMP CapAtCmdCmdTestcmd. CSA IMPORT
end if
class p1; // ProxyClass
class r1; //ReturnClass
US 2002/O124054 A1 Sep. 5, 2002
82
// C1 BEGIN
class EXP IMP CapAtCmdCmdTestcmd c1: public CapAtCmdObjBase
DECLARE CMD (c1)
// CMD EXECUTESYNC ( p1, r1 )
public:
bool execute ( p1* , r1* ) ;
bool executeSync (pl. , ril );
};
// c1 END
fiendlif
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// the business command object implementation file ...
A/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//Testcmd. Cmd. Cpp
#include <CsaCommon/CsaStringConvert.h>
#include "Testcmd. Cmd.h"
#include ". . /ProxRet/Testcmd prox.h"
#include ". . /ProxRet/Testcmd ret. h"
#include <At/CapAtMacDef.h>
// events
#include <At/CsaGenericComponent.h>
// c1 BEGIN
//MEDSW ArT: Hooks for starting and destroying CmdObjects from a
Genericcomponent
extern "C" int startupc1 (void*)
?/MEDSW ArT: Initialize your Command Objects here
return 0;
p1 * anotherPxy;
p1 *aPxy = NULL;
Static bool suspended=false;
int i ;
bool canceled= false;
bool delayed= false;
// évents
CsaGenericComponent * compptr= (CsaGenericComponent *) this
>getUserData ();
unsigned int timeout;
timeout = 10000;
int sum1;
int Sum2;
sum1 =acmdProxyPtr->getA () ;
sum2=aCmdProxyPtr->getB();
// simulate that BE has to ask the client user something and
// wait for answer!
if ( (Sum1 == 0) )
{
cout << "cmd delayed! !" << endl;
delayed=true;
//Add MoreResult (str result, -3, ret, s); // inform client:
delayed
aCmdRetPtr->setC (-3);
aCmdRetPtr-> reply (true);
bool r;
while (1)
{ r= this
> suspend (timeout, (CapAtCmdProxyBase **) &anotherPxy) ; // blocks here !
if (r)
{
// get the proxy data here and delete the proxy
later on
cout << "cmd continued !" << endl;
CString result;
result=anotherPxy->getResult () ;
char wbuff (20 O} :
CSA CSTRING TO ASCII (result, &vbuff (Ol);
Cout << " vall=" << vbuff C & endl;
sum1 = wtoi (LPCTSTR (result));
anotherPxy->destroy () ;
delayed=false;
//AddMoreResult (str result, - 4, ret, s) ; // inform
client: suspended
aCmdRetPtr->setC (-4);
aCmdRetPtr-> reply (true);
break; // resume normal operation
// timed out, so keep in loop
US 2002/O124054A1 Sep. 5, 2002
84
int Sum;
if (! canceled)
{
Slum = Sum1 + Slum2; A / the wole business logic ; -)
}
else sum= 0;
aCmdRetPtr->setC (sum);
if ( (this->getNumOf PendingRequest () > 5) && ! suspended)
{ compptr->notifyApplication ("xoff"); // évents
Suspended=true;
else