summaryrefslogtreecommitdiffstats
path: root/doc/kmplot/dcop.docbook
blob: 3907b650fb0fc9b59efb4abf44042bc5ea3eee3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
<chapter id="dcop">
	<title>Scripting &kmplot;</title>
	
	<para>A new feature in &kde; 3.4 is that you can write scrips for &kmplot; with &DCOP;. For example, if you want to define a new function <userinput>f(x)=2sin x+3cos x</userinput>, set its line width to 20 and then draw it, you type in a console:</para>
	<para><command>dcop kmplot-PID Parser addFunction "f(x)=2sin x+3cos x"</command>
		As a result, the new function's id number will be returned, or -1 if the function could not be defined.</para>
	<para><command>>dcop kmplot-PID Parser setFunctionFLineWidth 20 ID</command>
		This command sets the function with the id number ID the line width to 20.</para>
	<para><command>>dcop kmplot-PID View drawPlot</command>
	This command repaints the window so that the function get visible.</para>
<para>
	A list over the available functions:
	<variablelist>
		<varlistentry>
			<term>
				KmPlotShell fileOpen &amp;url
			</term>
			<listitem>
				<para>Load the file <parameter>url</parameter>.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg isModified
			</term>
			<listitem>
				<para>Returns true if any changes are done.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg editColors
			</term>
			<listitem>
				<para>Opens the color edit dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg editAxes
			</term>
			<listitem>
				<para>Opens the coordinate system edit dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg editScaling
			</term>
			<listitem>
				<para>Opens the scaling edit dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg editFonts
			</term>
			<listitem>
				<para>Opens the fonts edit dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg editConstants
			</term>
			<listitem>
				<para>Opens the constants edit dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg newFunction
			</term>
			<listitem>
				<para>Opens the new function plot dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg newParametric
			</term>
			<listitem>
				<para>Opens the new parametric plot dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg newPolar
			</term>
			<listitem>
				<para>Opens the new polar plot dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg toggleShowSlider0
			</term>
			<listitem>
				<para>Shows/hides parameter slider window number 1.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg toggleShowSlider1
			</term>
			<listitem>
				<para>Shows/hides parameter slider window number 2.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg toggleShowSlider2
			</term>
			<listitem>
				<para>Shows/hides parameter slider window number 3.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    		MainDlg toggleShowSlider3
		  </term>
		  <listitem>
		    <para>Shows/hides parameter slider window number 4.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotSave
			</term>
			<listitem>
				<para>Saves the functions (opens the save dialog if it is a new file).</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotSaveas
			</term>
			<listitem>
				<para>The same as choosing <menuchoice><guimenu>File</guimenu><guimenuitem>Save As</guimenuitem></menuchoice> in the menu.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotEditPlots
			</term>
			<listitem>
				<para>Opens the edit plots dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotPrint
			</term>
			<listitem>
				<para>Opens the print dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotExport
			</term>
			<listitem>
				<para>Opens the export dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotSettings
			</term>
			<listitem>
				<para>Opens the settings dialog.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotNames
			</term>
			<listitem>
				<para>Shows a list of predefined math functions.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotCoord1
			</term>
			<listitem>
				<para>Coordinate System I.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotCoord2
			</term>
			<listitem>
				<para>Coordinate System II.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg slotCoord3
			</term>
			<listitem>
				<para>Coordinate System III.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg getYValue
			</term>
			<listitem>
				<para>The same as choosing <menuchoice><guimenu>Tools</guimenu><guimenuitem>Get y-Value...</guimenuitem></menuchoice> in the menu.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg findMinimumValue
			</term>
			<listitem>
				<para>The same as choosing <menuchoice><guimenu>Tools</guimenu><guimenuitem>Search for Minimum Value...</guimenuitem></menuchoice> in the menu.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg findMaximumValue
			</term>
			<listitem>
				<para>The same as choosing <menuchoice><guimenu>Tools</guimenu><guimenuitem>Search for Maximum Value...</guimenuitem></menuchoice> in the menu.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				MainDlg graphArea
			</term>
			<listitem>
				<para>The same as choosing <menuchoice><guimenu>Tools</guimenu><guimenuitem>Calculate Integral</guimenuitem></menuchoice> in the menu.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				Parser addFunction f_str
			</term>
			<listitem>
				<para>Adds a new function with the expression <parameter>f_str</parameter>. If the expression does not contain a function name, it will be auto-generated. The id number of the new function is returned, or -1 if the function couln't be defined.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				Parser delfkt id
			</term>
			<listitem>
				<para>Removes the function with the id number <parameter>id</parameter>. If the function could not be deleted, false is returned, otherwise true.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				Parser setFunctionExpression f_str id
			</term>
			<listitem>
				<para>Sets the expression for the function with the id number <parameter>id</parameter> to <parameter>f_str</parameter>. Returns true if it succeed, otherwise false.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
				Parser countFunctions
			</term>
			<listitem>
				<para>Returns the number of functions (parametric functions are calculated as two).</para>
			</listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser listFunctionNames
		  </term>
		  <listitem>
		    <para>Returns a list with all functions.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser fnameToId f_str
		  </term>
		  <listitem>
		    <para>Returns the id number of <parameter>f_str</parameter> or -1 if the function name <parameter>f_str</parameter> was not found.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser id x
		  </term>
		  <listitem>
		    <para>Calculates the value <parameter>x</parameter> for the function with the ID <parameter>id</parameter> or returns 0.0 if <parameter>id</parameter> does not exist.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionFVisible id
		  </term>
		  <listitem>
		    <para>Returns true if the function with the ID <parameter>id</parameter> is visible, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionF1Visible id
		  </term>
		  <listitem>
		    <para>Returns true if the first derivative of the function with the ID <parameter>id</parameter> is visible, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionF2Visible id
		  </term>
		  <listitem>
		    <para>Returns true if the second derivative of the function with the ID <parameter>id</parameter> is visible, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionIntVisible id
		  </term>
		  <listitem>
		    <para>Returns true if the integral of the function with the ID <parameter>id</parameter> is visible, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionFVisible visible id
		  </term>
		  <listitem>
		    <para>Shows the function with the ID <parameter>id</parameter> if <parameter>visible</parameter> is true. If <parameter>visible</parameter> is false, the function will be hidden. True is returned if the function exists, otherwise false</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionF1Visible visible id
		  </term>
		  <listitem>
		    <para>Shows the first derivative of the function with the ID <parameter>id</parameter> if <parameter>visible</parameter> is true. If <parameter>visible</parameter> is false, the function will be hidden. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionF2Visible visible id
		  </term>
		  <listitem>
		    <para>Shows the second derivative of the function with the ID <parameter>id</parameter> if <parameter>visible</parameter> is true. If <parameter>visible</parameter> is false, the function will be hidden. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionIntVisible visible id
		  </term>
		  <listitem>
		    <para>Shows the integral of the function with the ID <parameter>id</parameter> if <parameter>visible</parameter> is true. If <parameter>visible</parameter> is false, the function will be hidden. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionStr id
		  </term>
		  <listitem>
		    <para>Returns the function expression of the function with the ID <parameter>id</parameter>. If the function not exists, an empty string is returned instead.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionFColor id
		  </term>
		  <listitem>
		    <para>Returns the color of the function with the ID <parameter>id</parameter>.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionF1Color id
		  </term>
		  <listitem>
		    <para>Returns the color of the first derivative of the function with the ID <parameter>id</parameter>.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionF2Color id
		  </term>
		  <listitem>
		    <para>Returns the color of the second derivative of the function with the ID <parameter>id</parameter>.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionIntColor id
		  </term>
		  <listitem>
		    <para>Returns the color of the integral of the function with the ID <parameter>id</parameter>.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionFColor color id
		  </term>
		  <listitem>
		    <para>Sets the color of the function with the ID <parameter>id</parameter> to <parameter>color</parameter>. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionF1Color color id
		  </term>
		  <listitem>
		    <para>Sets the color of the first derivative of the function with the ID <parameter>id</parameter> to <parameter>color</parameter>. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionF2Color color id
		  </term>
		  <listitem>
		    <para>Sets the color of the second derivative of the function with the ID <parameter>id</parameter> to <parameter>color</parameter>. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionIntColor color id
		  </term>
		  <listitem>
		    <para>Sets the color of the integral of the function with the ID <parameter>id</parameter> to <parameter>color</parameter>. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionFLineWidth id
		  </term>
		  <listitem>
		    <para>Returns the line width of the function with the ID <parameter>id</parameter>. If the function not exists, 0 is returned.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionF1LineWidth id
		  </term>
		  <listitem>
		    <para>Returns the line width of the first derivative of the function with the ID <parameter>id</parameter>. If the function not exists, 0 is returned.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionF2LineWidth id
		  </term>
		  <listitem>
		    <para>Returns the line width of the first derivative of the function with the ID <parameter>id</parameter>. If the function not exists, 0 is returned.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionIntLineWidth id
		  </term>
		  <listitem>
		    <para>Returns the line width of the integral of the function with the ID <parameter>id</parameter>. If the function not exists, 0 is returned.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionFLineWidth linewidth id
		  </term>
		  <listitem>
		    <para>Sets the line width of the function with the ID <parameter>id</parameter> to <parameter>linewidth</parameter>. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionF1LineWidth linewidth id
		  </term>
		  <listitem>
		    <para>Sets the line width of the first derivative of the function with the ID <parameter>id</parameter> to <parameter>linewidth</parameter>. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionF2LineWidth linewidth id
		  </term>
		  <listitem>
		    <para>Sets the line width of the second derivative of the function with the ID <parameter>id</parameter> to <parameter>linewidth</parameter>. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionIntLineWidth linewidth id
		  </term>
		  <listitem>
		    <para>Sets the line width of the integral of the function with the ID <parameter>id</parameter> to <parameter>linewidth</parameter>. True is returned if the function exists, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionParameterList id
		  </term>
		  <listitem>
		    <para>Returns a list with all the parameter values for the function with the ID <parameter>id</parameter>.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionAddParameter new_parameter id
		  </term>
		  <listitem>
		    <para>Adds the parameter value  <parameter>new_parameter</parameter> to the function with the ID <parameter>id</parameter>. True is returned if the operation succeed, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionRemoveParameter remove_parameter id
		  </term>
		  <listitem>
		    <para>Removes the parameter value <parameter>remove_parameter</parameter> from the function with the ID <parameter>id</parameter>. True is returned if the operation succeed, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionMinValue id
		  </term>
		  <listitem>
		    <para>Returns the minimum plot range value of the function with the ID <parameter>id</parameter>. If the function not exists or if the minimum value is not definied, an empty string is returned.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionMaxValue id
		  </term>
		  <listitem>
		    <para>Returns the maximum plot range value of the function with the ID <parameter>id</parameter>. If the function not exists or if the maximum value is not definied, an empty string is returned.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionMinValue min id
		  </term>
		  <listitem>
		    <para>Sets the minimum plot range value of the function with the ID <parameter>id</parameter> to <parameter>min</parameter>. True is returned if the function exists and the expression is valid, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionMaxValue max id
		  </term>
		  <listitem>
		    <para>Sets the maximum plot range value of the function with the ID <parameter>id</parameter> to <parameter>max</parameter>. True is returned if the function exists and the expression is valid, otherwise false.</para>
		  </listitem>
		</varlistentry>
		
		<varlistentry>
		  <term>
		    Parser functionStartXValue id
		  </term>
		  <listitem>
		    <para>Returns the initial x point for the integral of the function with the ID <parameter>id</parameter>. If the function not exists or if the x-point-expression is not definied, an empty string is returned.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser functionStartYValue id
		  </term>
		  <listitem>
		    <para>Returns the initial y point for the integral of the function with the ID <parameter>id</parameter>. If the function not exists or if the y-point-expression is not definied, an empty string is returned.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionStartXValue min id
		  </term>
		  <listitem>
		    <para>Sets the initial x point for the integral of the function with the ID <parameter>id</parameter> to <parameter>x</parameter>. True is returned if the function exists and the expression is valid, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <term>
		    Parser setFunctionStartYValue max id
		  </term>
		  <listitem>
		    <para>Sets the initial y point for the integral of the function with the ID <parameter>id</parameter> to <parameter>y</parameter>. True is returned if the function exists and the expression is valid, otherwise false.</para>
		  </listitem>
		</varlistentry>
		<varlistentry>
			<term>
			View stopDrawing
			</term>
			<listitem>
				<para>If &kmplot; currently is drawing a function, the procedure will stop.</para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term>
			View drawPlot
			</term>
			<listitem>
				<para>Redraws all functions.</para>
			</listitem>
		</varlistentry>
	</variablelist>
</para>
</chapter>

<!--
    Local Variables:
    mode: sgml
    sgml-minimize-attributes:nil
    sgml-general-insert-case:lower
    sgml-indent-step:0
    sgml-indent-data:nil
    sgml-parent-document:("index.docbook" "BOOK" "CHAPTER")
    End:
    -->