-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gelistirme.html
456 lines (273 loc) · 18.1 KB
/
Gelistirme.html
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
<!DOCTYPE HTML>
<html lang="en-US" manifest="./manifest.appcache">
<head prefix="og: http://ogp.me/ns# book: http://ogp.me/ns/book#">
<meta charset="UTF-8">
<title>Geliştirme | Railpower Dokümantasyonu</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="robots" content="index, follow">
<meta name="author" content="railpowerdocs">
<meta name="description" content="<a href="http://cl.ly/2V300m0S1y3n/librailpower-v1.0.1.zip" download="librailpower-v1.0.1.zip" title="librailpower-v1.0.1.zip"> <img src="http://img.shields.io/badge/RUNTIME_VERSİYON-1.0.1-blue.svg" alt="Versiyon 1.0.1"></a>">
<meta name="keywords" content="gitbook,github" >
<meta name="generator" content="www.gitbook.io">
<link rel="next" href="./Yapilacaklar.html" />
<link rel="prev" href="./Derleme.html" />
<meta property="og:title" content="Geliştirme | Railpower Dokümantasyonu">
<meta property="og:site_name" content="Railpower Dokümantasyonu">
<meta property="og:type" content="book">
<meta property="og:locale" content="en_US">
<meta property="book:author" content="https://github.com/railpower/railpowerdocs">
<meta property="book:tag" content="GitBook">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
</head>
<body>
<link rel="stylesheet" href="gitbook/style.css">
<div class="book" data-github="railpowerdocs" data-level="2.4" data-basepath="." data-revision="1401664204122">
<div class="book-header">
<!-- Actions Left -->
<a href="#" class="btn pull-left toggle-summary" aria-label="Toggle summary"><i class="fa fa-align-justify"></i></a>
<a href="https://github.com/railpower/railpowerdocs" target="_blank" class="btn pull-left home-bookmark" aria-label="GitHub home"><i class="fa fa-bookmark-o"></i></a>
<a href="#" class="btn pull-left toggle-search" aria-label="Toggle search"><i class="fa fa-search"></i></a>
<span id="font-settings-wrapper">
<a href="#" class="btn pull-left toggle-font-settings" aria-label="Toggle font settings"><i class="fa fa-font"></i>
</a>
<div class="dropdown-menu font-settings">
<div class="dropdown-caret">
<span class="caret-outer"></span>
<span class="caret-inner"></span>
</div>
<div class="btn-group btn-block">
<button id="reduce-font-size" class="btn btn-default">A</button>
<button id="enlarge-font-size" class="btn btn-default">A</button>
</div>
<ul class="list-group font-family-list">
<li class="list-group-item" data-font="0">Serif</li>
<li class="list-group-item" data-font="1">Sans</li>
</ul>
<div class="btn-group btn-group-xs btn-block color-theme-list">
<button type="button" class="btn btn-default" id="color-theme-preview-0" data-theme="0">White</button>
<button type="button" class="btn btn-default" id="color-theme-preview-1" data-theme="1">Sepia</button>
<button type="button" class="btn btn-default" id="color-theme-preview-2" data-theme="2">Night</button>
</div>
</div>
</span>
<!-- Actions Right -->
<a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Share on Google Plus"><i class="fa fa-google-plus"></i></a>
<a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Share on Facebook"><i class="fa fa-facebook"></i></a>
<a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Share on Twitter"><i class="fa fa-twitter"></i></a>
<a href="https://github.com/railpower/railpowerdocs/stargazers" target="_blank" class="btn pull-right count-star hidden-xs"><i class="fa fa-star-o"></i> Star (<span>-</span>)</a>
<a href="https://github.com/railpower/railpowerdocs/watchers" target="_blank" class="btn pull-right count-watch hidden-xs"><i class="fa fa-eye"></i> Watch (<span>-</span>)</a>
<!-- Title -->
<h1>
<i class="fa fa-spinner fa-spin"></i>
<a href="./" >Railpower Dokümantasyonu</a>
</h1>
</div>
<div class="book-summary">
<div class="book-search">
<input type="text" placeholder="Search" class="form-control" />
</div>
<ul class="summary">
<li>
<a href="https://github.com/railpower/railpowerdocs" target="blank" class="author-link">About the author</a>
</li>
<li>
<a href="https://github.com/railpower/railpowerdocs/issues" target="blank"class="issues-link">Questions and Issues</a>
</li>
<li>
<a href="https://github.com/railpower/railpowerdocs/edit/master/Gelistirme.md" target="blank" class="contribute-link">Edit and Contribute</a>
</li>
<li class="divider"></li>
<li data-level="0" data-path="index.html">
<a href="./"><i class="fa fa-check"></i> Introduction</a>
</li>
<li class="chapter " data-level="1" data-path="Icerik.html">
<a href="./Icerik.html">
<i class="fa fa-check"></i> <b>1.</b> Icerik
</a>
<ul class="articles">
<li class="chapter " data-level="1.1" data-path="NumerikIntegrator.html">
<a href="./NumerikIntegrator.html">
<i class="fa fa-check"></i> <b>1.1.</b> Numerik Integrator
</a>
</li>
<li class="chapter " data-level="1.2" data-path="Araclar.html">
<a href="./Araclar.html">
<i class="fa fa-check"></i> <b>1.2.</b> Araclar
</a>
</li>
<li class="chapter " data-level="1.3" data-path="Baglantilar.html">
<a href="./Baglantilar.html">
<i class="fa fa-check"></i> <b>1.3.</b> Baglantılar
</a>
</li>
<li class="chapter " data-level="1.4" data-path="SimulasyonBirimi.html">
<a href="./SimulasyonBirimi.html">
<i class="fa fa-check"></i> <b>1.4.</b> Simulasyon Birimi
</a>
</li>
<li class="chapter " data-level="1.5" data-path="Sonuclar.html">
<a href="./Sonuclar.html">
<i class="fa fa-check"></i> <b>1.5.</b> Sonuclar ve Test Paketleri
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="2" data-path="Runtime.html">
<a href="./Runtime.html">
<i class="fa fa-check"></i> <b>2.</b> Runtime Birimi (API)
</a>
<ul class="articles">
<li class="chapter " data-level="2.1" data-path="APIFonksiyonlari.html">
<a href="./APIFonksiyonlari.html">
<i class="fa fa-check"></i> <b>2.1.</b> API Fonksiyonları
</a>
</li>
<li class="chapter " data-level="2.2" data-path="Siniflar.html">
<a href="./Siniflar.html">
<i class="fa fa-check"></i> <b>2.2.</b> Sınıflar
</a>
</li>
<li class="chapter " data-level="2.3" data-path="Derleme.html">
<a href="./Derleme.html">
<i class="fa fa-check"></i> <b>2.3.</b> Derleme
</a>
</li>
<li class="chapter " data-level="2.4" data-path="Gelistirme.html">
<a href="./Gelistirme.html">
<i class="fa fa-check"></i> <b>2.4.</b> Geliştirme
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3" data-path="Yapilacaklar.html">
<a href="./Yapilacaklar.html">
<i class="fa fa-check"></i> <b>3.</b> Yapılacaklar
</a>
</li>
<li class="chapter " data-level="4" data-path="Kaynakca.html">
<a href="./Kaynakca.html">
<i class="fa fa-check"></i> <b>4.</b> Kaynakça
</a>
</li>
<li class="divider"></li>
</ul>
</div>
<div class="book-body">
<div class="body-inner">
<div class="page-wrapper" tabindex="-1">
<div class="book-progress">
<div class="bar">
<div class="inner" style="width: 84.61538461538461%;min-width: 76.92307692307692%;"></div>
</div>
<div class="chapters">
<a href="./index.html" title="Introduction" class="chapter done new-chapter" data-progress="0" style="left: 0%;"></a>
<a href="./Icerik.html" title="Icerik" class="chapter done new-chapter" data-progress="1" style="left: 7.6923076923076925%;"></a>
<a href="./NumerikIntegrator.html" title="Numerik Integrator" class="chapter done " data-progress="1.1" style="left: 15.384615384615385%;"></a>
<a href="./Araclar.html" title="Araclar" class="chapter done " data-progress="1.2" style="left: 23.076923076923077%;"></a>
<a href="./Baglantilar.html" title="Baglantılar" class="chapter done " data-progress="1.3" style="left: 30.76923076923077%;"></a>
<a href="./SimulasyonBirimi.html" title="Simulasyon Birimi" class="chapter done " data-progress="1.4" style="left: 38.46153846153846%;"></a>
<a href="./Sonuclar.html" title="Sonuclar ve Test Paketleri" class="chapter done " data-progress="1.5" style="left: 46.15384615384615%;"></a>
<a href="./Runtime.html" title="Runtime Birimi (API)" class="chapter done new-chapter" data-progress="2" style="left: 53.84615384615385%;"></a>
<a href="./APIFonksiyonlari.html" title="API Fonksiyonları" class="chapter done " data-progress="2.1" style="left: 61.53846153846154%;"></a>
<a href="./Siniflar.html" title="Sınıflar" class="chapter done " data-progress="2.2" style="left: 69.23076923076923%;"></a>
<a href="./Derleme.html" title="Derleme" class="chapter done " data-progress="2.3" style="left: 76.92307692307692%;"></a>
<a href="./Gelistirme.html" title="Geliştirme" class="chapter done " data-progress="2.4" style="left: 84.61538461538461%;"></a>
<a href="./Yapilacaklar.html" title="Yapılacaklar" class="chapter new-chapter" data-progress="3" style="left: 92.3076923076923%;"></a>
<a href="./Kaynakca.html" title="Kaynakça" class="chapter new-chapter" data-progress="4" style="left: 100%;"></a>
</div>
</div>
<div class="page-inner">
<section class="normal" id="section-gitbook_63">
<h1 id="gelistirme">Gelistirme</h1>
<h2 id="windows">Windows</h2>
<h3 id="visual-studio-ortam-nda">Visual Studio ortamında</h3>
<p>Varsayılan olarak depoda <code>cpp-vs</code> dizini altında visual studio için oluşturulmuş(Visual Studio 2012 Ultimate ile) ve konfigürasyonu hazırlanmış bir proje vardır. Proje konfigürasyonu farklı bir projeye aktarılacaksa aşağıdaki adımlar izlenmelidir.</p>
<p>Visual Studio ortamında geliştirme yapılacaksa <code>global.h</code> dosyasında değişikliğe gidilmesi gerekmektedir.</p>
<p>Aşağıda var olan <code>global.h</code>:</p>
<pre><code class="lang-cpp"><span class="hljs-preprocessor">#ifndef GLOBAL_H</span>
<span class="hljs-preprocessor">#define GLOBAL_H</span>
<span class="hljs-preprocessor">#if defined RAILPOWER</span>
<span class="hljs-preprocessor">#define RAILPOWER_SHARED __declspec(dllexport)</span>
<span class="hljs-preprocessor">#else</span>
<span class="hljs-preprocessor">#define RAILPOWER_SHARED __declspec(dllimport)</span>
<span class="hljs-preprocessor">#endif</span>
<span class="hljs-preprocessor">#endif <span class="hljs-comment">// GLOBAL_H</span></span>
</code></pre>
<p>Değişim:</p>
<pre><code class="lang-cpp"><span class="hljs-preprocessor">#ifndef GLOBAL_H</span>
<span class="hljs-preprocessor">#define GLOBAL_H</span>
<span class="hljs-preprocessor">#include <stdafx.h></span>
<span class="hljs-preprocessor">#if defined RAILPOWER</span>
<span class="hljs-preprocessor">#define RAILPOWER_SHARED __declspec(dllexport)</span>
<span class="hljs-preprocessor">#else</span>
<span class="hljs-preprocessor">#define RAILPOWER_SHARED __declspec(dllimport)</span>
<span class="hljs-preprocessor">#endif</span>
<span class="hljs-preprocessor">#endif <span class="hljs-comment">// GLOBAL_H</span></span>
</code></pre>
<p><strong>Yukarıda değişen konfigürasyon boş olmayan VS projeleri içindir</strong>
bu işlem sonrasında kütüphaneler ve headerlar visual studio'nun arama patikasına eklenir.</p>
<p>Patikanın eski hali aşağıdaki gibi iken:</p>
<pre><code>BLABLABLABLA;$(WindowsSDK_IncludePath);
</code></pre><p>yeni hali aşağıdaki gibi olmalıdır.</p>
<pre><code>BLABLABLABLA;$(WindowsSDK_IncludePath);.;
</code></pre><p>Bu ayar aşağıdaki pencereden değiştirilir:</p>
<p><img src="images/includedir.png" alt="Include Dirs" title="Include Dirs"></p>
<h2 id="qt-creator-ortam-nda">Qt Creator ortamında</h2>
<p><code>*.pro</code> dosyasında her zaman aşağıdaki satırların bulunmasına dikkat edilmelidir.</p>
<p>Aşağıdaki konfigürasyon parçacığı <code>pro</code> dosyasının en başında:</p>
<pre><code>TEMPLATE = lib
CONFIG += dll
CONFIG += c++11
</code></pre><p>Aşağıdaki parçacık ise en sonunda mutlaka olmalıdır:</p>
<pre><code>INCLUDEPATH += .
DEFINES += RAILPOWER
# __stdcall flags
#QMAKE_CFLAGS += /Gz
#QMAKE_CXXFLAGS += /Gz
DEF_FILE = Railpower.def
OTHER_FILES += \
Railpower.def
</code></pre><h2 id="genel-konvansiyonlar">Genel Konvansiyonlar</h2>
<p>Her DLL dışına export edilmesi istenen fonksiyon <code>Railpower.def</code> dosyasına aşağıda görülen yapıda yazılması gerekmektedir.</p>
<p><img src="images/deffile.png" alt="Def File" title="Def File"></p>
<p>Bir kodlama yapılanması olarak ebeveyn dosya diğer dosyalardaki yapıları kullanmaktadır. Ebeveyn dosya diğer dosyalar gibi camelCasing ile yazılmamıştır. Ebeveyn dosya projede <code>railpower.cpp</code> ismi ile fark edilebilir.</p>
<p>Bu dosya dışarıya export edilecek fonksiyonların yazım noktasıdır. Bu kısımda olabildiğince kompakt bir yapı sergileyip kullanım sırasına göre yazmamız bizim açımızdan birbirine yakın export edilmiş fonksiyonların derleyici tarafından oluşturulmasını sağlayacaktır. Aynı zamanda bu bize hızlı bir sistem de sağlar.</p>
<p><code>railpower.h</code> içerisinde bu exportlar aşağıdaki örnek satırlar gibi sırasıyla yazılmalıdır. Bu genel konvansiyondur. Sistem esnektir, istenildiği gibi değişikliğe gidilebilir.</p>
<pre><code class="lang-cpp">.
.
.
<span class="hljs-keyword">extern</span> <span class="hljs-string">"C"</span> RAILPOWER_SHARED <span class="hljs-keyword">int</span> addCouplingToSim(<span class="hljs-keyword">double</span> frontDistRefToCoupling, <span class="hljs-keyword">double</span> rearDistRefToCoupling, <span class="hljs-keyword">double</span> tensionDistance, <span class="hljs-keyword">bool</span> nullify);
<span class="hljs-keyword">extern</span> <span class="hljs-string">"C"</span> RAILPOWER_SHARED <span class="hljs-keyword">int</span> addForce(<span class="hljs-keyword">int</span> vehIndex, <span class="hljs-keyword">double</span> startTime, <span class="hljs-keyword">double</span> stopTime, <span class="hljs-keyword">double</span> forceValue);
<span class="hljs-keyword">extern</span> <span class="hljs-string">"C"</span> RAILPOWER_SHARED <span class="hljs-keyword">int</span> mapPointers();
<span class="hljs-keyword">extern</span> <span class="hljs-string">"C"</span> RAILPOWER_SHARED <span class="hljs-keyword">int</span> setMainCouplerSpringConstant(<span class="hljs-keyword">int</span> coupIndex, <span class="hljs-keyword">double</span> sprConst);
.
.
.
</code></pre>
</section>
</div>
</div>
</div>
<a href="./Derleme.html" class="navigation navigation-prev " aria-label="Previous page: Derleme"><i class="fa fa-angle-left"></i></a>
<a href="./Yapilacaklar.html" class="navigation navigation-next " aria-label="Next page: Yapılacaklar"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/mode-javascript.js"></script>
<script src="gitbook/jsrepl/jsrepl.js" id="jsrepl-script"></script>
<script src="gitbook/app.js"></script>
<script src="gitbook/plugins/gitbook-plugin-disqus/plugin.js"></script>
<script src="gitbook/plugins/gitbook-plugin-mixpanel/plugin.js"></script>
<script src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="gitbook/plugins/gitbook-plugin-mathjax/plugin.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"disqus":{"shortName":"railpowerdokumantasyon"},"fontSettings":{"family":"sans"}};
gitbook.start(config);
});
</script>
</body>
</html>