-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOITS.m
740 lines (599 loc) · 21.8 KB
/
OITS.m
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
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
function varargout = OITS(varargin)
% OITS MATLAB code for OITS.fig
% OITS, by itself, creates a new OITS or raises the existing
% singleton*.
%
% H = OITS returns the handle to a new OITS or the handle to
% the existing singleton*.
%
% OITS('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in OITS.M with the given input arguments.
%
% OITS('Property','Value',...) creates a new OITS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before OITS_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to OITS_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help OITS
% Last Modified by GUIDE v2.5 13-Sep-2018 10:35:49
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @OITS_OpeningFcn, ...
'gui_OutputFcn', @OITS_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before OITS is made visible.
function OITS_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to OITS (see VARARGIN)
% Choose default command line output for OITS
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes OITS wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = OITS_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
%
% This Function Executes on Selection of OPEN MISSION in Main Menu
%
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global This;
% Construct default filename from Project name (Use .mat matlab filetype)
default_file = strcat(This.name,'.mat') ;
% Get File
filename = uigetfile(default_file);
if (filename == 0 )
else
% Load Project Object from File into global Project 'This'
load(filename, 'This');
if (This.Body_Number<2)
return;
end
if (This.name=="Test")
This.name=filename;
if endsWith(This.name,".mat")
This.name=extractBefore(This.name,".mat");
elseif endsWith(This.name,".MAT")
This.name=extractBefore(This.name,".MAT");
end
end
set(handles.edit3,'string',This.name);
% Old Style Files Convert
if(~isprop(This, 'Max_dV')||isempty(This.Max_dV))
This.Max_dV(1:This.Current_Mission.Trajectory.Nbody)=1e50;
if(This.Min_Per(1)>0)
This.Max_dV(1)=sqrt(This.Min_Per(1))*1000;
This.Min_Per(1)=0.0;
end
elseif (~isprop(This.Current_Mission,'home_periapsis')||isempty(This.Current_Mission.home_periapsis))
This.Current_Mission.home_periapsis = 0.0;
end
if(~isprop(This,'Min_TI_flag')||isempty(This.Con_TI))
This.Min_TI_flag=0;
This.Con_TI(1:This.Current_Mission.Trajectory.Nbody)=-1e50;
end
if(~isprop(This,'AngleConstraint')||isempty(This.AngleConstraint))
for i=1:This.Current_Mission.Trajectory.Nbody
This.AngleConstraint(i,1)=atan2(This.Current_Mission.Trajectory.Body_Set(i).ephemt.r(2),This.Current_Mission.Trajectory.Body_Set(i).ephemt.r(1));
This.AngleConstraint(i,2)=asin(This.Current_Mission.Trajectory.Body_Set(i).ephemt.r(3)/This.Current_Mission.Trajectory.Body_Set(i).ephemt.R);
This.AngleConstraint(i,3)=-pi;
This.AngleConstraint(i,4)=pi;
This.AngleConstraint(i,5)=-pi/2;
This.AngleConstraint(i,6)=pi/2;
end
end
for i=1:This.Current_Mission.Trajectory.Nbody
if isempty(This.Current_Mission.Trajectory.Body_Set(i).mu)
This.Current_Mission.Trajectory.Body_Set(i).mu=0.0;
end
end
end
% --- Executes on button press in pushbutton2.
%
% This Function Executes on selection of NEW MISSION in main Menu
%
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Deal with selection of planets for This Mission
global This; % This Mission
global Body_pointer; % Pointer to Current Location in List of Bodies
global Itemstemp; % String List of Selected Bodies
global txt; % Tag for text box
global lst; % Tag for list box
Itemstemp=cell(This.Max_NBody);
%
% Reset the mission name
%
set(handles.edit3,'string','Test');
%
% Make Figure to allow selection of available Solar Systen Objects As Read
% in from SPICE KERNELS
%
%
figureselect=figure;
figureselect.ToolBar='none';
figureselect.MenuBar='none';
figureselect.Name='Select From Available Solar System Objects';
figureselect.Position= [300 378 900 420];
%
% Initialize array of Names of Available Solar System Objects to be
% displayed in the popupmenu
%
%
for i=1:This.NBody_List
Items(i)=cellstr(This.Body_List(i).name);
end
%
% Initialize List of Selected Bodies
%
%
if This.Body_Number>1
for i=1:This.Body_Number
Itemstemp(i)=cellstr(This.Body_Select(i).name);
end
else
Itemstemp(1)={""};
end
%
% Construct popupmenu in the current figure on LHS. These are all the
% available SPICE SSO's from which to choose
%
%
pop=uicontrol(figureselect,'Style', 'popupmenu', 'String', Items, 'Callback',@SelectBody);
pop.Position = [125 120 300 200];
txt=uicontrol(figureselect,'Style','text');
txt.Position=[110 320 300 50];
txt.FontSize=14;
txt.String=sprintf("Select Body Number %d",Body_pointer);
%
% Construct listbox in the current figure on RHS of currently selected SSO's from popupmenu
%
%
lst=uicontrol(figureselect,'Style', 'listbox', 'String', Itemstemp,'Callback', @GoBack);
lst.Position=[500 120 300 200];
%
% Construct pushbutton above listbox to allow exit of current Figure
%
%
but=uicontrol(figureselect,'Style', 'pushbutton', 'String', 'Quit Selection','Callback',@QuitSelect);
but.Position=[500 340 180 40];
but.FontSize=14;
%
% Construct pushbutton above listbox to allow clearance of currently selected list of SSO's
%
%
cle=uicontrol(figureselect,'Style', 'pushbutton', 'String', 'Clear Selection','Callback',@ClearSelect);
cle.Position=[700 340 180 40];
cle.FontSize=14;
% --- Executes on button press in pushbutton3.
%
% This Function Executes on Selection of SAVE MISSION in Main Menu
%
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global This;
%
% Save the current Project object 'This' into user specified file
%
%
if (This.Body_Number>1)
uisave('This',This.name);
end
% --- Executes on button press in pushbutton4.
%
% This Function Executes on Selection of SET OPTIMIZER DETAILS in Main Menu
% It Opens a new figure Called SET_MISSION which allows more detailed
% Project Settings
%
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global This;
global BODCHANGE;
BODCHANGE=0;
%
% Only Open Set_Mission if at least two SSO's have been selected
%
%
if (This.Body_Number>1)
This.factor =0.5;
%
% Check to see if Set_Mission has already been selected
%
if(isempty(This.Current_Mission))
%
% Check to see if The Optimizer has been executed on this mission yet
%
if(isempty(This.Solution))
%
% If this is a new mission construct List(array) of chosen Body Objects
%
This.Body_Chosen = Body(This.Body_Number);
%
% Inititalise List of chosen bodies
%
for i=1:This.Body_Number
This.Body_Chosen(i) = This.Body_Select(i);
%
% Inialise array of times
%
if (i==1)
time(i)=cspice_str2et(char(datetime('today')));
else
time(i)=time(i-1)+365*24*60*60;
end
end
%
% If this is a new mission, Construct the Mission based
% on data obtaines above
%
This.Current_Mission = Mission( This.Body_Chosen,time,This.Min_Spice_Select,This.Max_Spice_Select);
else
%
% Set Current Mission to Solution of Optimizer Run
% (This code is precautionary)
%
This.Current_Mission = This.Solution;
end
end
%
% Create The Set_Mission Figure based on details derived above or on
% The Current_Mission details as last specified
%
g = figure(Set_Mission);
uiwait(g);
while (BODCHANGE==1)
l=gcf;
l.Visible ='off';
g = figure(Set_Mission);
uiwait(g);
end
l=gcf;
l.Visible ='off';
% Ensure That Minimum times are all less than maxima and
% Ensure Initial Guess Lies in within min and max times
while max((This.Min_time>This.Current_Mission.Mission_Times)|(This.Max_time<This.Current_Mission.Mission_Times))>0
h=warndlg('ERROR FOUND IN TIME BOUNDS OR INITIAL GUESS');
uiwait(h);
BODCHANGE=0;
k = figure(Set_Mission);
uiwait(k);
while (BODCHANGE==1)
k = figure(Set_Mission);
uiwait(k);
end
end
l.Visible='on';
% Initialise Mission
% if (isempty(This.Solution))
%
% FlybyRendez=This.Current_Mission.FlybyRendez;
% wayflag=This.Current_Mission.wayflag;
% This.Current_Mission = This.Current_Mission.Set_Absolute_Times( This.Current_Mission.Mission_Times );
% This.Current_Mission = Mission( This.Body_Chosen,This.Current_Mission.Absolute_Times,This.Min_Spice_Select,This.Max_Spice_Select);
% This.Current_Mission.FlybyRendez=FlybyRendez;
% This.Current_Mission.wayflag=wayflag;
%
% end
end
% --- Executes on button press in pushbutton5.
%
% This Function Executes on Selection of VIEW RESULTS in Main Menu
%
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global This;
%
% Ensure this is a valid mission
%
if (This.Body_Number<2)
return;
end
% This=This.Solar_Oberth();
% This = This.Oumuamua_Data2(3000);
%
% Display Encounter Information and Periods of Obscuration by the sun if
% desired
%
This=This.View_Encounter_Details();
%
%
% Now Display Orbital Information in numeric form
%
This = This.View_Orbit_Info( 2 );
%
% Now Display Interplanetary Trajectory in 2D & 3D Plot form as well as orbits
% of SSO's. Also Display Speed Against Radial Distance Plot of Trajectory
%
This = This.View_Results( 600, 2);
% Firstly Display Basic Info in numeric form about the encounter with each SSO in turn
%
This = This.View_Info(2);
%
% Now Display Plots of Distance Against Time for Each SSO Encounter as well
% As 3D Trajectory for each SSO Encounter
%
%if (This.Body_Number>2)
% This = This.View_Planetary_Encounters( 600, 2 );
%end
% This = This.View_DeltaV_Vs_Time(500,2,365*24*60*60);
% --- Executes on button press in pushbutton6.
%
% This Function Executes on Selection of RUN OPTIMIZATION in Main Menu
%
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global This;
%
% Only Optimize if At least 2 Objects have been Selected
%
if (This.Body_Number>1)
%
% Initialize The Perihelia Constraints if They have been Chosen
%
This.NPerihelia = 0;
This.Nconstraints = This.Current_Mission.Trajectory.Nbody-2;
for i=2:This.Current_Mission.Trajectory.Nbody
if (This.Perihelia(i)>0.0)
This.NPerihelia = This.NPerihelia+1;
This.Per_Pointer(This.NPerihelia)= i;
end
end
%
% Run Optimizer On Current Project / Mission Combination
%
DVF=1;
prompt2='Objective DeltaV (y/n):';
answer2=inputdlg(prompt2);
if answer2=="n"||answer2=="N"
DVF=0;
if (This.Max_Duration<1e50)
prompt3='Remove Time Constraint (y/n) (if n then objective will be DeltaV) :';
answer3=inputdlg(prompt3);
if answer3=="n"||answer3=="N"
DVF=1;
else
This.Max_Duration=1e50;
end
end
end
This = This.Optimize_Mission(DVF);
end
%
% This Function Executes on Selection of a Body in the popupmenu on the
% LHS of NEW MISSION Figure
%
function SelectBody(source,event)
global This;
global Body_pointer; % Initialized to
global Itemstemp;
global txt;
global lst;
val= source.Value; % This is the row number of the popup selected
info = source.String; % This is not used
%
% New Mission Needs to be generated, any old missions are deleted
%
This.Current_Mission=[];
This.Solution=[];
%
% Add the selected Body on the LHS to the Selected Body List with the
% respective minimum and maximum SPICE times
%
This.Body_Select(Body_pointer)=This.Body_List(val);
%
% Check if The Selected Body is a CUSTOM BODY
%
%
if (contains(This.Body_Select(Body_pointer).ID,'CUSTOM BODY','IgnoreCase',true))
This.Body_Select(Body_pointer) = This.Body_Select(Body_pointer).Specify_Custom_Body(This.AU);
end
This.Min_Spice_Select(Body_pointer) = This.Min_Spice_Time(val);
This.Max_Spice_Select(Body_pointer) = This.Max_Spice_Time(val);
%
% Number of Selected Bodies (Already Initialized to 1 in run_OITS)
%
This.Body_Number = max(Body_pointer,This.Body_Number);
Body_pointer = Body_pointer+1;
txt.String=sprintf("Select Body Number %d",Body_pointer);
%
% Display String for Selected Body List on RHS of Figure
%
for i=1:This.Body_Number
Itemstemp(i)=cellstr(This.Body_Select(i).name);
end
lst.String=Itemstemp;
%
% This function is executed if User Selects one of the SSO's that he has
% already selected on the RHS of the NEW MISSION figure
%
function GoBack(source,event)
global Body_pointer;
global txt;
global This;
val= source.Value;
info = source.String;
if (val <= This.Body_Number+1)
Body_pointer=val;
txt.String=sprintf("Select Body Number %d",Body_pointer);
end
%
% This function is executed if the Quit Option Is selected in the NEW
% MISSION figure
%
function QuitSelect(source,event)
global This;
%
% Only Initialise Current Mission if more than one SSO is Selected
%
if (This.Body_Number>1)
%
% Construct the Body list of Chosen Objects
%
This.Body_Chosen = Body(This.Body_Number);
%
% Construct and zero the List of Time Ranges needed for the Optimizer,
% THESE MUST LATER BE SPECIFIED BY USER
%
This.Min_time=zeros(1,This.Body_Number);
This.Max_time=zeros(1,This.Body_Number);
%
% Construct and zero:
% 1) List of Minimum Periapsis Distances
% 2) List of Minimum Perihelia Disances
% THESE MUST LATER BE SPECIFIED BY USER
%
This.Min_Per=zeros(1,This.Body_Number);
This.Max_dV=zeros(1,This.Body_Number);
This.Con_TI=zeros(1,This.Body_Number);
This.Perihelia=zeros(1,This.Body_Number);
% The following must be specified by user.
for i=1:This.Body_Number
This.Min_Per(i)=0.0;
This.Max_dV(i)=1e50;
This.Con_TI(i)=-1e50;
end
%
% Initialize the Body List of Chosen Objects
%
for i=1:This.Body_Number
This.Body_Chosen(i) = This.Body_Select(i);
if (i==1)
time(i)=cspice_str2et(char(datetime('today')));
else
time(i)=time(i-1)+2*365*24*60*60;
end
%
% Initialize the Fixed Points
%
if This.Body_Chosen(i).Fixed_Point>0
This.Body_Chosen(i).ephem0.r = [This.AU*cos(i*pi/100) This.AU*sin(i*pi/100) 0];
This.Body_Chosen(i).ephem0.v = [ 0 0 0 ];
This.Body_Chosen(i).ephem0.t = time(i);
This.AngleConstraint(i,1)=i*pi/100;
This.AngleConstraint(i,2)=0.0;
This.AngleConstraint(i,3)=-pi;
This.AngleConstraint(i,4)=pi;
This.AngleConstraint(i,5)=-pi/2;
This.AngleConstraint(i,6)=pi/2;
This.Min_Per(i)=norm(This.Body_Chosen(i).ephem0.r);
else
This.AngleConstraint(i,1:6)=0.0;
end
end
%
% Now Construct The Current Mission Object and Initialize as Required
%
This.Current_Mission = Mission( This.Body_Chosen,time,This.Min_Spice_Select,This.Max_Spice_Select);
for i=1:This.Body_Number
This.Min_time(i)=This.Current_Mission.Mission_Times(i)-60*60*24*28;
This.Max_time(i)=This.Current_Mission.Mission_Times(i)+60*60*24*28;
end
end
close;
%
% This function is executed if the Clear Selection Option Is selected in the NEW
% MISSION figure
%
function ClearSelect(source,event)
global This;
global Body_pointer;
global txt;
global lst;
global Itemstemp;
This.Body_Select=Body;
for i=1:This.Body_Number
Itemstemp(i)={""};
end
Body_pointer=1;
This.Body_Number=1;
txt.String=sprintf("Select Body Number %d",Body_pointer);
lst.String=Itemstemp;
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close;
% --- Executes on button press in pushbutton8.
%
% This Function Executes on Selection of ANIMATE RESULTS in Main Menu
%
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global This;
%
% Ensure this is a valid mission
%
if (This.Body_Number<2)
return;
end
title=inputdlg("Enter Title for Animation","");
% titleanim=input('Enter Title of Animation:','s');
% This= This.Animate_Results(int64(50000/This.Current_Mission.Trajectory.Nbody), 2, titleanim);
if (~isempty(title))
titleanim=char(title);
w1=msgbox('Starting Animation Please Wait - You Will be Informed When Animation is Complete','');
This= This.Animate_Results(int64(5000/This.Current_Mission.Trajectory.Nbody), 2, titleanim);
w2=helpdlg('Animation Complete and Stored in File TrajVideo.mp4','');
uiwait(w2);
end
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
global This;
This.name=get(hObject,'String');
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end