forked from Dexter9313/KerbalLocalTime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KerbalLocalTime.cs
655 lines (578 loc) · 21 KB
/
KerbalLocalTime.cs
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
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using KSP.IO;
using UnityEngine;
using KSP.UI.Screens;
[KSPAddon(KSPAddon.Startup.EveryScene, false)]
public class LocalTimePart : MonoBehaviour
{
StylesManager styman = new StylesManager();
protected Rect windowPos;
protected Rect optionsWindowPos;
public static bool toggled = false;
public static bool options = false;
public static bool displayksc = true;
public static bool displaylocal = true;
public static bool displayrel = true;
public static bool displayreal = true;
public static bool display24ksc = true;
public static bool display24local = true;
public static bool display24rel = true;
public static bool display24real = true;
public static bool displaySecsksc = true;
public static bool displaySecslocal = true;
public static bool displaySecsrel = true;
public static bool displaySecsreal = true;
public static bool displayTZksc = true;
public static bool displayTZlocal = true;
public static bool displayTZrel = true;
private static LocalTimePart instance;
public static bool coreinited = false;
private static PluginConfiguration config = null;
private bool existsSecs()
{
return ((displaySecslocal && displaylocal) || (displaySecsrel && displayrel) || (displaySecsksc && displayksc) || (displaySecsreal && displayreal));
}
private bool existsAm()
{
return ((!display24local && displaylocal) || (!display24rel && displayrel) || (!display24ksc && displayksc) || (!display24real && displayreal));
}
private bool existsBoth()
{
return ((!display24local && displaySecslocal && displaylocal)
|| (!display24rel && displaySecsrel && displayrel)
|| (!display24ksc && displaySecsksc && displayksc)
|| (!display24real && displaySecsreal && displayreal));
}
private void WindowGUI(int windowID)
{
try
{
String vesselMainBodyName = FlightGlobals.ActiveVessel.mainBody.bodyName;
GUILayout.BeginVertical(styman.layoutStyle);
if (displaylocal)
{
GUILayout.Label("Local Time", styman.timeLabelStyle);
timeDoubleToDisplay(localTime(FlightGlobals.ActiveVessel.mainBody), timeZone(FlightGlobals.ActiveVessel.mainBody), display24local, displaySecslocal, displayTZlocal, FlightGlobals.ActiveVessel.mainBody.bodyName.First());
}
if (displayrel)
{
GUILayout.Label(FlightGlobals.ActiveVessel.mainBody.referenceBody.bodyName + " Related Time", styman.timeLabelStyle);
if (FlightGlobals.ActiveVessel.mainBody.isStar)
{
timeDoubleToDisplay(localTime(FlightGlobals.ActiveVessel.mainBody), timeZone(FlightGlobals.ActiveVessel.mainBody), display24local, displaySecslocal, displayTZlocal, FlightGlobals.ActiveVessel.mainBody.bodyName.First());
}
else
{
timeDoubleToDisplay(localRelativeTime(FlightGlobals.ActiveVessel.mainBody.referenceBody), timeZone(FlightGlobals.ActiveVessel.mainBody.referenceBody), display24rel, displaySecsrel, displayTZrel, FlightGlobals.ActiveVessel.mainBody.referenceBody.bodyName.First());
}
}
if (displayksc)
{
GUILayout.Label("KSC Time", styman.timeLabelStyle);
timeDoubleToDisplay(kscTime(), 0, display24ksc, displaySecsksc, displayTZksc, 'K');
}
if (displayreal)
{
GUILayout.Label("Real World Time", styman.timeLabelStyle);
realWorldTime();
}
GUILayout.EndVertical();
}
catch
{
GUILayout.BeginVertical(styman.layoutStyle);
if (displayksc)
{
GUILayout.Label("KSC Time", styman.timeLabelStyle);
timeDoubleToDisplay(kscTime(), 0, display24ksc, displaySecsksc, displayTZksc, 'K');
}
GUILayout.EndVertical();
}
//DragWindow makes the window draggable. The Rect specifies which part of the window it can by dragged by, and is
//clipped to the actual boundary of the window. You can also pass no argument at all and then the window can by
//dragged by any part of it. Make sure the DragWindow command is AFTER all your other GUI input stuff, or else
//it may "cover up" your controls and make them stop responding to the mouse.
GUI.DragWindow();
}
private void OptionsGUI(int windowID)
{
bool before;
bool wndChanged = false;
bool optChanged = false;
GUILayout.BeginVertical();
before=displaylocal;
displaylocal = GUILayout.Toggle(before, "Local Time", styman.toggleStyle);
wndChanged = (before != displaylocal) || wndChanged;
optChanged = (before != displaylocal) || optChanged;
if(displaylocal)
{
GUILayout.BeginHorizontal(styman.layoutStyle);
before=display24local;
display24local = GUILayout.Toggle(display24local, "24hours", styman.toggleStyle);
wndChanged = (before != display24local) || wndChanged;
before=displaySecslocal;
displaySecslocal = GUILayout.Toggle(displaySecslocal, "seconds", styman.toggleStyle);
wndChanged = (before != displaySecslocal) || wndChanged;
before=displayTZlocal;
displayTZlocal = GUILayout.Toggle(displayTZlocal, "time zone", styman.toggleStyle);
wndChanged = (before != displayTZlocal) || wndChanged;
GUILayout.EndHorizontal();
}
before=displayrel;
displayrel = GUILayout.Toggle(before, "Relative Time to Planet", styman.toggleStyle);
wndChanged = (before != displayrel) || wndChanged;
optChanged = (before != displayrel) || optChanged;
if(displayrel)
{
GUILayout.BeginHorizontal(styman.layoutStyle);
before=display24rel;
display24rel = GUILayout.Toggle(display24rel, "24hours", styman.toggleStyle);
wndChanged = (before != display24rel) || wndChanged;
before=displaySecsrel;
displaySecsrel = GUILayout.Toggle(displaySecsrel, "seconds", styman.toggleStyle);
wndChanged = (before != displaySecsrel) || wndChanged;
before=displayTZrel;
displayTZrel = GUILayout.Toggle(displayTZrel, "time zone", styman.toggleStyle);
wndChanged = (before != displayTZrel) || wndChanged;
GUILayout.EndHorizontal();
}
before = displayksc;
displayksc = GUILayout.Toggle(before, "KSC Time", styman.toggleStyle);
wndChanged = (before != displayksc) || wndChanged;
optChanged = (before != displayksc) || optChanged;
if(displayksc)
{
GUILayout.BeginHorizontal(styman.layoutStyle);
before = display24ksc;
display24ksc = GUILayout.Toggle(display24ksc, "24hours", styman.toggleStyle);
wndChanged = (before != display24ksc) || wndChanged;
before = displaySecsksc;
displaySecsksc = GUILayout.Toggle(displaySecsksc, "seconds", styman.toggleStyle);
wndChanged = (before != displaySecsksc) || wndChanged;
before = displayTZksc;
displayTZksc = GUILayout.Toggle(displayTZksc, "time zone", styman.toggleStyle);
wndChanged = (before != displayTZksc) || wndChanged;
GUILayout.EndHorizontal();
}
before = displayreal;
displayreal = GUILayout.Toggle(before, "Real Time", styman.toggleStyle);
wndChanged = (before != displayreal) || wndChanged;
if(displayreal)
{
GUILayout.BeginHorizontal(styman.layoutStyle);
before = display24real;
display24real = GUILayout.Toggle(display24real, "24hours", styman.toggleStyle);
wndChanged = (before != display24real) || wndChanged;
before = displaySecsreal;
displaySecsreal = GUILayout.Toggle(displaySecsreal, "seconds", styman.toggleStyle);
wndChanged = (before != displaySecsreal) || wndChanged;
GUILayout.EndHorizontal();
}
GUILayout.EndVertical();
if(wndChanged)
{
if (windowPos.xMax > Screen.currentResolution.width)
{
windowPos.xMin = 0;
windowPos.xMax = Screen.currentResolution.width /2;
}
if (windowPos.yMax > Screen.currentResolution.height)
{
windowPos.yMin = 0;
windowPos.yMax = Screen.currentResolution.height / 2;
}
windowPos.height = 0;
windowPos.width = 200 * GameSettings.UI_SCALE;
}
if(optChanged)
{
if (optionsWindowPos.xMax > Screen.currentResolution.width)
{
optionsWindowPos.xMin = 0;
optionsWindowPos.xMax = Screen.currentResolution.width / 2;
}
if (optionsWindowPos.yMax > Screen.currentResolution.height)
{
optionsWindowPos.yMin = 0;
optionsWindowPos.yMax = Screen.currentResolution.height / 2;
}
optionsWindowPos.height = 0;
optionsWindowPos.width = 350 * GameSettings.UI_SCALE;
}
GUI.DragWindow(new Rect(0, 0, 10000, 20));
}
private void OnGUI()
{
if(toggled && ((HighLogic.LoadedSceneIsFlight) || HighLogic.LoadedScene.Equals(GameScenes.SPACECENTER) || HighLogic.LoadedScene.Equals(GameScenes.TRACKSTATION)))
{
styman.loadStyles();
windowPos = GUILayout.Window(this.GetInstanceID(), windowPos, WindowGUI, "Kerbal Local Time",styman.windowStyle);
}
if(options && ((HighLogic.LoadedSceneIsFlight) || HighLogic.LoadedScene.Equals(GameScenes.SPACECENTER) || HighLogic.LoadedScene.Equals(GameScenes.TRACKSTATION)))
{
styman.loadStyles();
optionsWindowPos = GUILayout.Window(this.GetInstanceID()+1, optionsWindowPos, OptionsGUI, "KLT Options", styman.windowStyle);
}
}
public void Toggle()
{
if ((HighLogic.LoadedSceneIsFlight) || HighLogic.LoadedScene.Equals(GameScenes.SPACECENTER) || HighLogic.LoadedScene.Equals(GameScenes.TRACKSTATION))
{
if (toggled == true)
{
saveConfig(true,false);
}
}
toggled = !toggled;
}
public void ToggleOptions()
{
if ((HighLogic.LoadedSceneIsFlight) || HighLogic.LoadedScene.Equals(GameScenes.SPACECENTER) || HighLogic.LoadedScene.Equals(GameScenes.TRACKSTATION))
{
if (options == true)
{
saveConfig(false,true);
}
options = !options;
}
}
[KSPAction("Options", actionGroup = KSPActionGroup.None)]
public void ToggleOptionsAction(KSPActionParam param)
{
ToggleOptions();
}
private void Start()
{
if (instance == null)
{
instance = this;
}
else
{
UnityEngine.Object.DestroyImmediate(this);
}
coreinited = true;
loadConfig();
windowPos.height = 0;
windowPos.width = 200 * GameSettings.UI_SCALE;
optionsWindowPos.height = 0;
optionsWindowPos.width = 350 * GameSettings.UI_SCALE;
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.F7) && !(Input.GetKey(KeyCode.RightShift) || Input.GetKey(KeyCode.LeftShift)))
{
Toggle();
}
if (Input.GetKey(KeyCode.RightShift) || Input.GetKey(KeyCode.LeftShift))
{
if (Input.GetKeyDown(KeyCode.F7))
{
ToggleOptions();
}
}
}
private void OnDestroy()
{
if (coreinited)
{
if ((toggled == true) && ((HighLogic.LoadedSceneIsFlight) || HighLogic.LoadedScene.Equals(GameScenes.SPACECENTER) || HighLogic.LoadedScene.Equals(GameScenes.TRACKSTATION)))
{
saveConfig(false, false);
}
if ((options == true) && ((HighLogic.LoadedSceneIsFlight) || HighLogic.LoadedScene.Equals(GameScenes.SPACECENTER) || HighLogic.LoadedScene.Equals(GameScenes.TRACKSTATION)))
{
saveConfig(false, false);
}
}
}
protected static double localSolarTime(CelestialBody body) //may be used later for planets rise
{
double solarDayLength = body.solarDayLength;
double time = Planetarium.GetUniversalTime() + (body.solarDayLength / 2);
double day = (int)(time / solarDayLength);
double TimeOfDay = ((time - (day * solarDayLength)) / solarDayLength) * 24;
return TimeOfDay;
}
protected static double trueRelativeTime(CelestialBody body) //relative to reference body
{
if (body.isStar)
return 12;
return localSolarTime(body) + exactTimeZone(body);
}
protected static double trueTime(CelestialBody body)
{
if (body.isStar)
return 12;
return localSolarTime(body) + exactTimeZone(body);
}
protected static double kmtRelativeTime(CelestialBody body) //relative to reference body
{
if (body.isStar)
return 12;
return localSolarTime(body);
}
protected static double kmtTime(CelestialBody body)
{
if (body.isStar)
return 12;
return localSolarTime(body);
}
protected static double timeZone(CelestialBody body)
{
double timeZ;
if (body.isStar)
{
return 0;
}
else
{
if (body.Equals(FlightGlobals.currentMainBody))
{
timeZ = Math.Round(FlightGlobals.ActiveVessel.longitude * 24 / 360) + 5;
}
else
{
timeZ = Math.Round(body.GetLongitude(FlightGlobals.ActiveVessel.GetWorldPos3D(), true) * 24 / 360) + 5;
}
}
while(timeZ > 12)
timeZ -= 24;
while(timeZ < -11)
timeZ += 24;
return timeZ;
}
protected static double exactTimeZone(CelestialBody body)
{
double timeZ;
if (body.isStar)
{
return 0;
}
else
{
timeZ = body.GetLongitude(FlightGlobals.ActiveVessel.GetWorldPos3D(), true) * 24 / 360 + 5;
}
while (timeZ > 12)
timeZ -= 24;
while (timeZ < -11)
timeZ += 24;
return timeZ;
}
protected static double localRelativeTime(CelestialBody body)
{
if(FlightGlobals.ActiveVessel.mainBody.isStar)
return 12;
double localT = kmtRelativeTime(body) + timeZone(body);
while (localT < 0)
localT += 24;
return localT % 24;
}
protected static double localTime(CelestialBody body)
{
if(FlightGlobals.ActiveVessel.mainBody.isStar)
return 12;
double localT = kmtTime(body) + timeZone(body);
while (localT < 0)
localT += 24;
return localT % 24;
}
protected static double kscTime()
{
return localSolarTime(FlightGlobals.GetHomeBody());
}
protected void realWorldTime()
{
String realWorldT = "";
if(display24real)
realWorldT = System.DateTime.Now.ToLocalTime().ToString("HH:mm");
else
realWorldT = System.DateTime.Now.ToLocalTime().ToString("hh:mm");
if(displaySecsreal)
realWorldT += System.DateTime.Now.ToLocalTime().ToString(":ss");
if(!display24real)
realWorldT += System.DateTime.Now.ToLocalTime().ToString("tt", CultureInfo.InvariantCulture);
GUILayout.Label(realWorldT);
}
protected void timeDoubleToDisplay(double time, double timeZone, bool display24, bool displaySecs, bool displayTZ, char TZfirstLetter)
{
while (timeZone > 12)
timeZone -= 24;
while (timeZone < -11)
timeZone += 24;
double amState = 0;
if (!display24)
{
if (time >= 12)
{
amState = 1;
time -= 12;
}
if (time < 0)
{
time += 12;
}
}
double timecpy = time;
double hourfirdig = Math.Floor(time / 10);
double hoursecdig = Math.Floor(time) % 10;
timecpy = 60*(time - Math.Floor(time));
double minfirdig = Math.Floor(timecpy / 10);
double minsecdig = Math.Floor(timecpy) % 10;
timecpy = 60*(timecpy - Math.Floor(timecpy));
double secfirdig = Math.Floor(timecpy / 10);
double secsecdig = Math.Floor(timecpy) % 10;
double gmtSign = (timeZone < 0) ? -1 : 1;
double timeZonecpy = timeZone * gmtSign;
double gmtfirdig = Math.Floor(timeZonecpy / 10);
double gmtsecdig = Math.Floor(timeZonecpy) % 10;
bool dispminsep = (System.DateTime.Now.Millisecond < 500) || displaySecs;
String result = "";
result += hourfirdig.ToString() + hoursecdig.ToString() + ":" + minfirdig.ToString() + minsecdig.ToString();
if (displaySecs)
result += ":" + secfirdig.ToString() + secsecdig.ToString();
if (!display24)
result += (amState == 0) ? "AM" : "PM";
if (displayTZ)
result += " (" + TZfirstLetter.ToString() + "MT" + ((timeZone >= 0) ? "+" : "") + Math.Round(timeZone).ToString() + ")";
GUILayout.Label(result,styman.timeStyle);
}
public static string kscTimeStringToDisplay()
{
double time = kscTime();
double timeZone = 0;
bool display24 = display24ksc;
bool displayTZ = displayTZksc;
bool displaySecs = displaySecsksc;
while (timeZone > 12)
timeZone -= 24;
while (timeZone < -11)
timeZone += 24;
double amState = 0;
if (!display24)
{
if (time >= 12)
{
amState = 1;
time -= 12;
}
if (time < 0)
{
time += 12;
}
}
double timecpy = time;
double hourfirdig = Math.Floor(time / 10);
double hoursecdig = Math.Floor(time) % 10;
timecpy = 60 * (time - Math.Floor(time));
double minfirdig = Math.Floor(timecpy / 10);
double minsecdig = Math.Floor(timecpy) % 10;
timecpy = 60 * (timecpy - Math.Floor(timecpy));
double secfirdig = Math.Floor(timecpy / 10);
double secsecdig = Math.Floor(timecpy) % 10;
double gmtSign = (timeZone < 0) ? -1 : 1;
double timeZonecpy = timeZone * gmtSign;
double gmtfirdig = Math.Floor(timeZonecpy / 10);
double gmtsecdig = Math.Floor(timeZonecpy) % 10;
bool dispminsep = (System.DateTime.Now.Millisecond < 500) || displaySecs;
String result = "";
result += hourfirdig.ToString() + hoursecdig.ToString() + ":" + minfirdig.ToString() + minsecdig.ToString();
if (displaySecs)
result += ":" + secfirdig.ToString() + secsecdig.ToString();
if (!display24)
result += (amState == 0) ? "AM" : "PM";
if (displayTZ)
result += " (" + "K" + "MT" + ((timeZone >= 0) ? "+" : "") + Math.Round(timeZone).ToString() + ")";
return result;
}
protected CelestialBody getKerbin()
{
return FlightGlobals.GetHomeBody();
}
protected void saveConfig(bool forcetogglefalse, bool forceoptionsfalse)
{
print("Kerbal Local Time : saving config");
config.SetValue("windowPos", windowPos);
config.SetValue("optionsWindowPos", optionsWindowPos);
if (!forcetogglefalse)
{
config.SetValue("toggled", toggled);
}
else
{
config.SetValue("toggled", false);
}
if (!forceoptionsfalse)
{
config.SetValue("options", options);
}
else
{
config.SetValue("options", false);
}
config.SetValue("displayksc", displayksc);
config.SetValue("displaylocal", displaylocal);
config.SetValue("displayrel", displayrel);
config.SetValue("displayreal", displayreal);
config.SetValue("display24ksc", display24ksc);
config.SetValue("display24local", display24local);
config.SetValue("display24rel", display24rel);
config.SetValue("display24real", display24real);
config.SetValue("displaySecsksc", displaySecsksc);
config.SetValue("displaySecslocal", displaySecslocal);
config.SetValue("displaySecsrel", displaySecsrel);
config.SetValue("displaySecsreal", displaySecsreal);
config.SetValue("displayTZksc", displayTZksc);
config.SetValue("displayTZlocal", displayTZlocal);
config.SetValue("displayTZrel", displayTZrel);
config.save();
}
protected void loadConfig()
{
print("Kerbal Local Time : loading config");
config = KSP.IO.PluginConfiguration.CreateForType<LocalTimePart>(null);
config.load();
windowPos = config.GetValue<Rect>("windowPos", new Rect(Screen.currentResolution.width / 2, Screen.currentResolution.height / 2, 0, 0));
if (windowPos.xMax > Screen.currentResolution.width)
{
windowPos.xMin = 0;
windowPos.xMax = Screen.currentResolution.width / 2;
}
if (windowPos.yMax > Screen.currentResolution.height)
{
windowPos.yMin = 0;
windowPos.yMax = Screen.currentResolution.height / 2;
}
optionsWindowPos = config.GetValue<Rect>("optionsWindowPos", new Rect(Screen.currentResolution.width / 2, Screen.currentResolution.height / 2, 0, 0));
if (optionsWindowPos.xMax > Screen.currentResolution.width)
{
optionsWindowPos.xMin = 0;
optionsWindowPos.xMax = Screen.currentResolution.width / 2;
}
if (optionsWindowPos.yMax > Screen.currentResolution.height)
{
optionsWindowPos.yMin = 0;
optionsWindowPos.yMax = Screen.currentResolution.height / 2;
}
toggled = config.GetValue<bool>("toggled", false);
options = config.GetValue<bool>("options", false);
displayksc = config.GetValue<bool>("displayksc", true);
displaylocal = config.GetValue<bool>("displaylocal", true);
displayrel = config.GetValue<bool>("displayrel", false);
displayreal = config.GetValue<bool>("displayreal", false);
display24ksc = config.GetValue<bool>("display24ksc", false);
display24local = config.GetValue<bool>("display24local", false);
display24rel = config.GetValue<bool>("display24rel", false);
display24real = config.GetValue<bool>("display24real", false);
displaySecsksc = config.GetValue<bool>("displaySecsksc", false);
displaySecslocal = config.GetValue<bool>("displaySecslocal", false);
displaySecsrel = config.GetValue<bool>("displaySecsrel", false);
displaySecsreal = config.GetValue<bool>("displaySecsreal", false);
displayTZksc = config.GetValue<bool>("displayTZksc", true);
displayTZlocal = config.GetValue<bool>("displayTZlocal", true);
displayTZrel = config.GetValue<bool>("displayTZrel", false);
}
}