0001 function ltpdv_buildImportPanel(ph, mainfig)
0002
0003 Gproperties = getappdata(mainfig, 'Gproperties');
0004
0005 pmarg = 0.025;
0006
0007
0008
0009
0010
0011 Hmargin = 0.025;
0012 Vmargin = 0.025;
0013
0014 PanLeft = Hmargin;
0015 Tleft = Hmargin;
0016 Theight = 1-2*Vmargin;
0017 Tbottom = (1 - Theight - Vmargin);
0018 Twidth = 1-2*Hmargin;
0019
0020 Pcol = [1 1 0.9];
0021
0022 htab = uitabgroup('Parent', ph, ...
0023 'Units','normalized',...
0024 'Tag', 'LTPDVimportTabPanel', ...
0025 'Position',[Tleft Tbottom Twidth Theight], 'SelectionChangeFcn', {@ltpdv_tabChanged});
0026 mt1 = uitab(htab, 'title', 'Server');
0027 mt2 = uitab(htab, 'title', 'Workspace');
0028 mt3 = uitab(htab, 'title', 'Build');
0029
0030
0031 buildServerPanel(mt1, mainfig);
0032
0033 h = buildWorkspacePanel(mt2, mainfig);
0034
0035 buildBuildPanel(mt3, mainfig);
0036 end
0037
0038
0039
0040 function buildBuildPanel(hp, mainfig)
0041
0042
0043 EditFontSize = 11;
0044 vmarg = 0.03;
0045 pmarg = 0.01;
0046 CommHeight = EditFontSize/400;
0047 ph = 1;
0048 htab = uipanel('Parent', hp, 'Position', [pmarg 1-ph-pmarg 1-2*pmarg ph]);
0049 set(htab, 'Units', 'Normalized')
0050 set(htab, 'Title', '')
0051 set(htab, 'BackgroundColor', [0.6 0.6 0.8]);
0052 set(htab, 'ForegroundColor', 'w');
0053
0054
0055
0056 bh = CommHeight;
0057 bl = pmarg;
0058 bw = 0.15;
0059 bb = 1-bh-1*vmarg;
0060 sth = uicontrol(htab, 'Style','text',...
0061 'String', 'Object Class',...
0062 'Units', 'normalized', ...
0063 'BackgroundColor', 'w', ...
0064 'Fontsize', EditFontSize, ...
0065 'Position',[bl bb bw bh]);
0066 bl = bl+bw+pmarg;
0067 bw = 0.2;
0068 clsh = uicontrol(htab, ...
0069 'Style', 'popupmenu', ...
0070 'Units', 'normalized',...
0071 'Fontsize', EditFontSize, ...
0072 'BackgroundColor', 'w', ...
0073 'String', utils.helper.ltpda_userclasses, ...
0074 'Position', [bl bb bw bh],...
0075 'Tag', 'LTPDVbuildObjectClass', ...
0076 'Callback', {@ltpdv_build_class_select, mainfig});
0077
0078
0079 bl = bl+bw+pmarg;
0080 bw = 0.15;
0081 sth = uicontrol(htab, 'Style','text',...
0082 'String', 'Parameter Set',...
0083 'Units', 'normalized', ...
0084 'BackgroundColor', 'w', ...
0085 'Fontsize', EditFontSize, ...
0086 'Position',[bl bb bw bh]);
0087 bl = bl+bw+pmarg;
0088 bw = 0.3;
0089 dtypeh = uicontrol(htab, ...
0090 'Style', 'popupmenu', ...
0091 'Units', 'normalized',...
0092 'Fontsize', EditFontSize, ...
0093 'BackgroundColor', 'w', ...
0094 'String', ' ', ...
0095 'Position', [bl bb bw bh],...
0096 'Tag', 'LTPDVbuildSetSelect', ...
0097 'Callback', {@ltpdv_build_set_select, mainfig});
0098
0099
0100 ph = 0.8;
0101 ppan = uipanel('Parent', htab, 'Position', [pmarg 0.08+vmarg 1-2*pmarg ph]);
0102 set(ppan, 'Units', 'Normalized')
0103 set(ppan, 'Title', 'Parameters')
0104 set(ppan, 'BackgroundColor', [0.7 0.7 0.8]);
0105 set(ppan, 'ForegroundColor', 'w');
0106 set(ppan, 'Tag', 'LTPDVbuildParamsPanel');
0107
0108 pbh = uicontrol(htab,'Style','pushbutton',...
0109 'String','Build object',...
0110 'Callback', {@ltpdv_build_buildobject, mainfig}, ...
0111 'Units', 'normalized', ...
0112 'Fontsize', EditFontSize, ...
0113 'Position',[pmarg vmarg 0.15 2*bh]);
0114
0115
0116 ltpdv_build_class_select(clsh, mainfig)
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130 end
0131
0132
0133 function buildServerPanel(hp, mainfig)
0134
0135
0136 EditFontSize = 11;
0137 vmarg = 0.03;
0138 pmarg = 0.01;
0139 CommHeight = EditFontSize/80;
0140
0141
0142 bw = 0.12;
0143 bh = 0.05;
0144 bl = pmarg;
0145 bb = pmarg;
0146 pbh = uicontrol(hp,'Style','pushbutton',...
0147 'String','Import',...
0148 'Callback', {@ltpdv_server_import, mainfig}, ...
0149 'Units', 'normalized', ...
0150 'Fontsize', EditFontSize, ...
0151 'Position',[bl bb bw bh]);
0152
0153
0154 Tleft = pmarg;
0155 Theight = 0.8;
0156 Tbottom = 1-Theight - pmarg;
0157 Twidth = 1-2*pmarg;
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167 ph = 0.3;
0168 htab = uipanel('Parent', hp, 'Position', [pmarg 1-ph-pmarg 1-2*pmarg ph]);
0169 set(htab, 'Units', 'Normalized')
0170 set(htab, 'Title', 'Server settings')
0171 set(htab, 'BackgroundColor', [0.3 0.7 0.3]);
0172 set(htab, 'ForegroundColor', 'w');
0173
0174 bh = CommHeight;
0175 bl = pmarg;
0176 bw = 0.1;
0177 bb = 1-bh-3*vmarg;
0178 sth = uicontrol(htab, 'Style','text',...
0179 'String', 'Data type',...
0180 'Units', 'normalized', ...
0181 'BackgroundColor', 'w', ...
0182 'Fontsize', EditFontSize, ...
0183 'Position',[bl bb bw bh]);
0184 bl = bl+bw+pmarg;
0185 bw = 0.17;
0186 dtypeh = uicontrol(htab, ...
0187 'Style', 'popupmenu', ...
0188 'Units', 'normalized',...
0189 'Fontsize', EditFontSize, ...
0190 'BackgroundColor', 'w', ...
0191 'String', {'frame data','h(t) frames', 'raw data', 'hour trends', 'day trends'}, ...
0192 'Position', [bl bb bw bh],...
0193 'Tag', 'LTPDVserverDataType', ...
0194 'Callback', {@ltpdv_server_datatype_select, mainfig});
0195
0196
0197 bl = bl + bw + pmarg;
0198 bw = 0.1;
0199 sth = uicontrol(htab, 'Style','text',...
0200 'String', 'Statistic',...
0201 'Units', 'normalized', ...
0202 'BackgroundColor', 'w', ...
0203 'Fontsize', EditFontSize, ...
0204 'Position',[bl bb bw bh]);
0205 bl = bl+bw+pmarg;
0206 bw = 0.12;
0207 th = uicontrol(htab, ...
0208 'Style', 'popupmenu', ...
0209 'Units', 'normalized',...
0210 'BackgroundColor', 'w', ...
0211 'Fontsize', EditFontSize, ...
0212 'String', {'rms','min', 'max', 'avg'}, ...
0213 'Position', [bl bb bw bh],...
0214 'Tag', 'LTPDVserverStat');
0215
0216
0217 bl = pmarg;
0218 bw = 0.1;
0219 bb = bb - bh - vmarg;
0220 sth = uicontrol(htab, 'Style','text',...
0221 'String', 'Server',...
0222 'Units', 'normalized', ...
0223 'BackgroundColor', 'w', ...
0224 'Fontsize', EditFontSize, ...
0225 'Position',[bl bb bw bh]);
0226 bl = bl+bw+pmarg;
0227 bw = 0.25;
0228 th = uicontrol(htab, ...
0229 'Style', 'popupmenu', ...
0230 'Units', 'normalized',...
0231 'BackgroundColor', 'w', ...
0232 'String', {'130.75.117.159','130.75.117.73', '130.75.117.164', 'localhost'}, ...
0233 'Fontsize', EditFontSize, ...
0234 'Position', [bl bb bw bh],...
0235 'Tag', 'LTPDVserverServer', ...
0236 'Callback', {@ltpdv_server_server_select, mainfig});
0237
0238
0239 bl = bl+bw+pmarg;
0240 bw = 0.22;
0241 th = uicontrol(htab, ...
0242 'Style', 'edit', ...
0243 'Units', 'normalized',...
0244 'BackgroundColor', 'w', ...
0245 'Fontsize', EditFontSize, ...
0246 'String', '', ...
0247 'Position', [bl bb bw bh],...
0248 'Tag', 'LTPDVserverServerEdit');
0249
0250
0251 bl = bl+bw+pmarg;
0252 bw = 0.07;
0253 sth = uicontrol(htab, 'Style','text',...
0254 'String', 'Port',...
0255 'Units', 'normalized', ...
0256 'BackgroundColor', 'w', ...
0257 'Fontsize', EditFontSize, ...
0258 'Position',[bl bb bw bh]);
0259 bl = bl+bw+pmarg;
0260 bw = 0.1;
0261 th = uicontrol(htab, ...
0262 'Style', 'edit', ...
0263 'Units', 'normalized',...
0264 'BackgroundColor', 'w', ...
0265 'Fontsize', EditFontSize, ...
0266 'String', '', ...
0267 'Position', [bl bb bw bh],...
0268 'Tag', 'LTPDVserverPortEdit');
0269
0270
0271 bl = pmarg;
0272 bw = 0.1;
0273 bb = bb - bh - vmarg;
0274 sth = uicontrol(htab, 'Style','text',...
0275 'String', 'RDS Level',...
0276 'Units', 'normalized', ...
0277 'BackgroundColor', 'w', ...
0278 'Fontsize', EditFontSize, ...
0279 'Position',[bl bb bw bh]);
0280 bl = bl+bw+pmarg;
0281 bw = 0.05;
0282 th = uicontrol(htab, ...
0283 'Style', 'edit', ...
0284 'Units', 'normalized',...
0285 'BackgroundColor', 'w', ...
0286 'Fontsize', EditFontSize, ...
0287 'String', '', ...
0288 'Position', [bl bb bw bh],...
0289 'Tag', 'LTPDVserverRdsEdit');
0290
0291
0292 bl = pmarg + bl + bw;
0293 bw = 0.1;
0294 sth = uicontrol(htab, 'Style','text',...
0295 'String', 'Cal Ver',...
0296 'Units', 'normalized', ...
0297 'BackgroundColor', 'w', ...
0298 'Fontsize', EditFontSize, ...
0299 'Position',[bl bb bw bh]);
0300 bl = bl+bw+pmarg;
0301 bw = 0.05;
0302 th = uicontrol(htab, ...
0303 'Style', 'edit', ...
0304 'Units', 'normalized',...
0305 'BackgroundColor', 'w', ...
0306 'Fontsize', EditFontSize, ...
0307 'String', '', ...
0308 'Position', [bl bb bw bh],...
0309 'Tag', 'LTPDVserverCalEdit');
0310
0311
0312
0313 ltpdv_server_server_select(0, mainfig);
0314 ltpdv_server_datatype_select(dtypeh, mainfig);
0315
0316
0317 bw = 0.13;
0318 bb = vmarg;
0319 bl = pmarg;
0320 pbh = uicontrol(htab,'Style','pushbutton',...
0321 'String','Query Server',...
0322 'Callback', {@ltpdv_server_queryServer, mainfig}, ...
0323 'Units', 'normalized', ...
0324 'Fontsize', EditFontSize, ...
0325 'Position',[bl bb bw 1.4*CommHeight]);
0326
0327
0328 bl = bl + bw + pmarg;
0329 pbh = uicontrol(htab,'Style','pushbutton',...
0330 'String','Get latest',...
0331 'Callback', {@ltpdv_server_getLatest, mainfig}, ...
0332 'Units', 'normalized', ...
0333 'Fontsize', EditFontSize, ...
0334 'Position',[bl bb bw 1.4*CommHeight]);
0335
0336
0337
0338
0339 ph = 0.3;
0340 htab = uipanel('Parent', hp, 'Position', [pmarg 1-2*ph-2*pmarg 1-2*pmarg ph]);
0341 set(htab, 'Units', 'Normalized')
0342 set(htab, 'Title', 'Times settings')
0343 set(htab, 'BackgroundColor', [0.7 0.3 0.3]);
0344 set(htab, 'ForegroundColor', 'w');
0345
0346
0347 bb = 1-0.7*bh-pmarg;
0348 bl = pmarg+0.4;
0349 bw = 0.5;
0350 timesH = uicontrol(htab, 'Style','text',...
0351 'String', 'Times',...
0352 'Units', 'normalized', ...
0353 'BackgroundColor', 'w', ...
0354 'Fontsize', EditFontSize, ...
0355 'Position',[bl bb bw 0.7*bh]);
0356
0357 bl = pmarg + 0.4;
0358 bh = 0.7;
0359 bb = bb - bh;
0360 lh = uicontrol(htab, 'Style', 'listbox', ...
0361 'String', '',...
0362 'BackgroundColor', 'w', ...
0363 'Value',1, 'Units', 'normalized', ...
0364 'Fontsize', EditFontSize, ...
0365 'Max', 1000, ...
0366 'Tag', 'LTPDVtimesList', ...
0367 'Position',[bl bb bw bh], ...
0368 'Callback', {@ltpdv_server_timeslist, mainfig});
0369
0370
0371 bw = (0.5 - 3*pmarg)/ 4;
0372 bh = CommHeight;
0373 bb = bb - bh - vmarg;
0374 pbh = uicontrol(htab,'Style','pushbutton',...
0375 'String','Delete times',...
0376 'Callback', {@ltpdv_server_deleteTimes, mainfig}, ...
0377 'Units', 'normalized', ...
0378 'Fontsize', EditFontSize, ...
0379 'Position',[bl bb bw bh]);
0380
0381 bl = bl + pmarg + bw;
0382 pbh = uicontrol(htab,'Style','pushbutton',...
0383 'String','Clear list',...
0384 'Callback', {@ltpdv_server_clearTimes, mainfig}, ...
0385 'Units', 'normalized', ...
0386 'Fontsize', EditFontSize, ...
0387 'Position',[bl bb bw bh]);
0388
0389 bl = bl + pmarg + bw;
0390 pbh = uicontrol(htab,'Style','pushbutton',...
0391 'String','Save list',...
0392 'Callback', {@ltpdv_server_saveTimes, mainfig}, ...
0393 'Units', 'normalized', ...
0394 'Fontsize', EditFontSize, ...
0395 'Position',[bl bb bw bh]);
0396
0397 bl = bl + pmarg + bw;
0398 pbh = uicontrol(htab,'Style','pushbutton',...
0399 'String','Load list',...
0400 'Callback', {@ltpdv_server_loadTimes, mainfig}, ...
0401 'Units', 'normalized', ...
0402 'Fontsize', EditFontSize, ...
0403 'Position',[bl bb bw bh]);
0404
0405
0406 pos = get(timesH, 'Position');
0407 bl = pmarg;
0408 bw = 0.1;
0409 bh = CommHeight;
0410 bb = pos(2)-2*vmarg;
0411 sth = uicontrol(htab, 'Style','text',...
0412 'String', 'Start',...
0413 'Units', 'normalized', ...
0414 'BackgroundColor', 'w', ...
0415 'Fontsize', EditFontSize, ...
0416 'Position',[bl bb bw bh]);
0417 bl = bl+bw+pmarg;
0418 bw = 0.25;
0419 th = uicontrol(htab, ...
0420 'Style', 'edit', ...
0421 'Units', 'normalized',...
0422 'BackgroundColor', 'w', ...
0423 'Fontsize', EditFontSize, ...
0424 'String', '', ...
0425 'Position', [bl bb bw bh],...
0426 'Callback', {@ltpdv_server_start_edit, mainfig}, ...
0427 'Tag', 'LTPDVserverStartEdit');
0428
0429 bl = pmarg;
0430 bw = 0.1;
0431 bb = bb - bh - vmarg;
0432 sth = uicontrol(htab, 'Style','text',...
0433 'String', 'Stop',...
0434 'Units', 'normalized', ...
0435 'BackgroundColor', 'w', ...
0436 'Fontsize', EditFontSize, ...
0437 'Position',[bl bb bw bh]);
0438 bl = bl+bw+pmarg;
0439 bw = 0.25;
0440 th = uicontrol(htab, ...
0441 'Style', 'edit', ...
0442 'Units', 'normalized',...
0443 'BackgroundColor', 'w', ...
0444 'String', '', ...
0445 'Fontsize', EditFontSize, ...
0446 'Position', [bl bb bw bh],...
0447 'Callback', {@ltpdv_server_stop_edit, mainfig}, ...
0448 'Tag', 'LTPDVserverStopEdit');
0449
0450
0451 bw = 0.1;
0452 bl = pmarg;
0453 bb = bb - bh - vmarg;
0454 sth = uicontrol(htab, 'Style','text',...
0455 'String', 'Duration',...
0456 'Units', 'normalized', ...
0457 'BackgroundColor', 'w', ...
0458 'Fontsize', EditFontSize, ...
0459 'Position',[bl bb bw bh]);
0460 bl = bl + bw + pmarg;
0461 bw = 0.25;
0462 sth = uicontrol(htab, 'Style','text',...
0463 'String', '',...
0464 'Units', 'normalized', ...
0465 'BackgroundColor', 'w', ...
0466 'Fontsize', EditFontSize, ...
0467 'Tag', 'LTPDVserverDurationDisplay', ...
0468 'Position',[bl bb bw bh]);
0469
0470
0471 pos = get(sth, 'Position');
0472 bl = pmarg;
0473 bw = pos(1) + pos(3) - pmarg;
0474 bb = bb - 0.7*bh - vmarg;
0475 sth = uicontrol(htab, 'Style','text',...
0476 'String', 'Comment',...
0477 'Units', 'normalized', ...
0478 'BackgroundColor', 'w', ...
0479 'Fontsize', EditFontSize, ...
0480 'Position',[bl bb bw bh*0.7]);
0481 bb = bb - bh - pmarg;
0482 bl = pmarg;
0483 th = uicontrol(htab, ...
0484 'Style', 'edit', ...
0485 'Units', 'normalized',...
0486 'BackgroundColor', 'w', ...
0487 'String', '', ...
0488 'Fontsize', EditFontSize, ...
0489 'Position', [bl bb bw bh],...
0490 'Tag', 'LTPDVserverCommentEdit');
0491
0492
0493 bl = pmarg;
0494 bb = bb - bh - vmarg;
0495 pbh = uicontrol(htab,'Style','pushbutton',...
0496 'String','Add to list',...
0497 'Fontsize', EditFontSize, ...
0498 'Callback', {@ltpdv_server_addTime, mainfig}, ...
0499 'Units', 'normalized', ...
0500 'Position',[bl bb bw bh]);
0501
0502
0503
0504 ph = 0.3;
0505 htab = uipanel('Parent', hp, 'Position', [pmarg pmarg+2*vmarg 1-2*pmarg ph]);
0506 set(htab, 'Units', 'Normalized')
0507 set(htab, 'Title', 'Channel settings')
0508 set(htab, 'BackgroundColor', [0.3 0.3 0.7]);
0509 set(htab, 'ForegroundColor', 'w');
0510
0511 bw = 0.5;
0512 bb = 1 - vmarg - 0.7*bh;
0513 bl = pmarg;
0514 sth = uicontrol(htab, 'Style','text',...
0515 'String', 'Channels',...
0516 'Units', 'normalized', ...
0517 'BackgroundColor', 'w', ...
0518 'Fontsize', EditFontSize, ...
0519 'Position',[bl bb bw 0.7*bh]);
0520 bh = 0.8;
0521 bb = bb - bh;
0522 lh = uicontrol(htab, 'Style', 'listbox', ...
0523 'String', '',...
0524 'BackgroundColor', 'w', ...
0525 'Value',1, 'Units', 'normalized', ...
0526 'Fontsize', EditFontSize, ...
0527 'Max', 1000, ...
0528 'Tag', 'LTPDVchannelList', ...
0529 'Position',[bl bb bw bh], ...
0530 'Callback', {@ltpdv_server_channellist, mainfig});
0531
0532
0533
0534
0535
0536
0537
0538
0539
0540
0541
0542
0543
0544
0545
0546
0547 bl = 0.55;
0548 bw = 0.08;
0549 bh = CommHeight;
0550 bb = 1 - vmarg - bh;
0551 sth = uicontrol(htab, 'Style','text',...
0552 'String', 'Search',...
0553 'Units', 'normalized', ...
0554 'BackgroundColor', 'w', ...
0555 'Fontsize', EditFontSize, ...
0556 'Position',[bl bb bw bh]);
0557 bl = bl+bw+pmarg;
0558 bw = 0.17;
0559 th = uicontrol(htab, ...
0560 'Style', 'edit', ...
0561 'Units', 'normalized',...
0562 'BackgroundColor', 'w', ...
0563 'String', '', ...
0564 'Fontsize', EditFontSize, ...
0565 'Position', [bl bb bw bh],...
0566 'Callback', {@ltpdv_search_channels, mainfig}, ...
0567 'Tag', 'LTPDVchannelSearchEdit');
0568 pos = get(sth, 'Position');
0569 bl = pos(1);
0570 bb = bb - bh - vmarg;
0571 pbh = uicontrol(htab,'Style','pushbutton',...
0572 'String','Get channels',...
0573 'Fontsize', EditFontSize, ...
0574 'Callback', {@ltpdv_server_getChannels, mainfig}, ...
0575 'Units', 'normalized', ...
0576 'Position',[bl bb bw bh]);
0577 end
0578
0579
0580 function th = buildWorkspacePanel(hp, mainfig)
0581
0582
0583 pmarg = 0.025;
0584 Lleft = pmarg;
0585 Lbottom = 0.4+pmarg;
0586 Lwidth = 1-2*pmarg;
0587 Lheight = 1-Lbottom-pmarg;
0588 th = uitable(hp, ...
0589 'Units', 'normalized',...
0590 'ColumnName', {'Name','Type', 'Size', 'kB'}, ...
0591 'Position', [Lleft Lbottom Lwidth Lheight],...
0592 'Tag', 'LTPDVworkspaceList', ...
0593 'CellSelectionCallback', {@ltpdv_workspaceList_select, mainfig});
0594
0595
0596 ltpdv_workspaceList_set_data(th);
0597
0598
0599 pl = pmarg;
0600 ph = 0.05;
0601 pb = Lbottom - ph - pmarg;
0602 pw = 0.1;
0603 pbh = uicontrol(hp,'Style','pushbutton',...
0604 'String','Refresh',...
0605 'Callback', {@ltpdv_workspaceList_set_data, th}, ...
0606 'Units', 'normalized', ...
0607 'Position',[pl pb pw ph]);
0608
0609
0610 pl = pmarg + pw + pmarg;
0611 ph = 0.05;
0612 pb = Lbottom - ph - pmarg;
0613 pw = 0.1;
0614 pbh = uicontrol(hp,'Style','pushbutton',...
0615 'String','Import',...
0616 'Callback', {@ltpdv_importObjs, mainfig, th}, ...
0617 'Units', 'normalized', ...
0618 'Position',[pl pb pw ph]);
0619
0620
0621 pl = pl + pw + pmarg;
0622 ph = 0.05;
0623 pb = Lbottom - ph - pmarg;
0624 pw = 0.3;
0625 ch = uicontrol(hp, 'Style', 'checkbox', ...
0626 'String', 'use var name', ...
0627 'TooltipString', 'Set object name to workspace variable name.', ...
0628 'Units', 'normalized', ...
0629 'Position', [pl pb pw ph], ...
0630 'Value', 1, ...
0631 'Tag', 'LTPDVusevarnameChk');
0632
0633 end
0634
0635
0636
0637
0638