Rev 85 | Rev 87 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 85 | Rev 86 | ||
---|---|---|---|
Line 47... | Line 47... | ||
47 | IdentificationsListView: TVTSListView; |
47 | IdentificationsListView: TVTSListView; |
48 | ErrorsTabSheet: TTabSheet; |
48 | ErrorsTabSheet: TTabSheet; |
49 | ErrorsMemo: TMemo; |
49 | ErrorsMemo: TMemo; |
50 | Memo1: TMemo; |
50 | Memo1: TMemo; |
51 | Panel1: TPanel; |
51 | Panel1: TPanel; |
52 | Button1: TButton; |
52 | OpenTDFButton: TButton; |
53 | Button2: TButton; |
53 | SaveTDFButton: TButton; |
54 | TasksPopupMenu: TPopupMenu; |
54 | TasksPopupMenu: TPopupMenu; |
55 | Run1: TMenuItem; |
55 | Run1: TMenuItem; |
56 | Properties1: TMenuItem; |
56 | Properties1: TMenuItem; |
57 | IdentificationsPopupMenu: TPopupMenu; |
57 | IdentificationsPopupMenu: TPopupMenu; |
58 | CopyTaskDefinitionExample1: TMenuItem; |
58 | CopyTaskDefinitionExample1: TMenuItem; |
Line 60... | Line 60... | ||
60 | VersionLabel: TLabel; |
60 | VersionLabel: TLabel; |
61 | LoadedPluginsPopupMenu: TPopupMenu; |
61 | LoadedPluginsPopupMenu: TPopupMenu; |
62 | MenuItem1: TMenuItem; |
62 | MenuItem1: TMenuItem; |
63 | Panel2: TPanel; |
63 | Panel2: TPanel; |
64 | Image2: TImage; |
64 | Image2: TImage; |
- | 65 | DynamicTestGroupbox: TGroupBox; |
|
- | 66 | DynamicTestPluginComboBox: TComboBox; |
|
- | 67 | DynamicTestPluginLabel: TLabel; |
|
- | 68 | DynamicTestDataLabel: TLabel; |
|
- | 69 | DynamicTestDataEdit: TEdit; |
|
65 | Button5: TButton; |
70 | DynamicTestButton: TButton; |
66 | procedure FormDestroy(Sender: TObject); |
71 | procedure FormDestroy(Sender: TObject); |
67 | procedure TasksListViewDblClick(Sender: TObject); |
72 | procedure TasksListViewDblClick(Sender: TObject); |
68 | procedure TasksListViewKeyPress(Sender: TObject; var Key: Char); |
73 | procedure TasksListViewKeyPress(Sender: TObject; var Key: Char); |
69 | procedure Button1Click(Sender: TObject); |
74 | procedure OpenTDFButtonClick(Sender: TObject); |
70 | procedure Button2Click(Sender: TObject); |
75 | procedure SaveTDFButtonClick(Sender: TObject); |
71 | procedure URLLabelClick(Sender: TObject); |
76 | procedure URLLabelClick(Sender: TObject); |
72 | procedure TasksPopupMenuPopup(Sender: TObject); |
77 | procedure TasksPopupMenuPopup(Sender: TObject); |
73 | procedure Run1Click(Sender: TObject); |
78 | procedure Run1Click(Sender: TObject); |
74 | procedure Properties1Click(Sender: TObject); |
79 | procedure Properties1Click(Sender: TObject); |
75 | procedure IdentificationsPopupMenuPopup(Sender: TObject); |
80 | procedure IdentificationsPopupMenuPopup(Sender: TObject); |
Line 77... | Line 82... | ||
77 | procedure ListViewCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer); |
82 | procedure ListViewCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer); |
78 | procedure Button3Click(Sender: TObject); |
83 | procedure Button3Click(Sender: TObject); |
79 | procedure LoadedPluginsPopupMenuPopup(Sender: TObject); |
84 | procedure LoadedPluginsPopupMenuPopup(Sender: TObject); |
80 | procedure MenuItem1Click(Sender: TObject); |
85 | procedure MenuItem1Click(Sender: TObject); |
81 | procedure FormCreate(Sender: TObject); |
86 | procedure FormCreate(Sender: TObject); |
82 | procedure Button5Click(Sender: TObject); |
87 | procedure DynamicTestButtonClick(Sender: TObject); |
83 | protected |
88 | protected |
84 | ud2: TUD2; |
89 | ud2: TUD2; |
85 | procedure LoadTaskList; |
90 | procedure LoadTaskList; |
86 | procedure LoadDetectedIDs; |
91 | procedure LoadDetectedIDs; |
87 | procedure LoadINITemplate; |
92 | procedure LoadINITemplate; |
88 | procedure LoadLoadedPluginList; |
93 | procedure LoadLoadedPluginList; |
- | 94 | procedure LoadDynamicPluginList; |
|
89 | function GetIniFileName: string; |
95 | function GetIniFileName: string; |
90 | procedure DoRun(ShortTaskName: string); |
96 | procedure DoRun(ShortTaskName: string); |
91 | procedure CheckForErrors; |
97 | procedure CheckForErrors; |
92 | public |
98 | public |
93 | procedure Run; |
99 | procedure Run; |
Line 347... | Line 353... | ||
347 | Caption := pl.PluginDLL; |
353 | Caption := pl.PluginDLL; |
348 | SubItems.Add(pl.PluginVendor); |
354 | SubItems.Add(pl.PluginVendor); |
349 | SubItems.Add(pl.PluginName); |
355 | SubItems.Add(pl.PluginName); |
350 | SubItems.Add(pl.PluginVersion); |
356 | SubItems.Add(pl.PluginVersion); |
351 | SubItems.Add(pl.IdentificationMethodName); |
357 | SubItems.Add(pl.IdentificationMethodName); |
- | 358 | if pl.AcceptsDynamicRequests then |
|
- | 359 | SubItems.Add('Yes') |
|
- | 360 | else |
|
- | 361 | SubItems.Add('No'); |
|
352 | SubItems.Add(IntToStr(pl.DetectedIdentifications.Count)); |
362 | SubItems.Add(IntToStr(pl.DetectedIdentifications.Count)); |
353 | SubItems.Add(Format(LNG_MS, [Max(1,pl.time)])); // at least show 1ms, otherwise it would be unloggical |
363 | SubItems.Add(Format(LNG_MS, [Max(1,pl.time)])); // at least show 1ms, otherwise it would look unloggical |
354 | SubItems.Add(pl.IdentificationProcedureStatusCodeDescribed); |
364 | SubItems.Add(pl.IdentificationProcedureStatusCodeDescribed); |
355 | SubItems.Add(pl.PluginGUIDString); |
365 | SubItems.Add(pl.PluginGUIDString); |
356 | end; |
366 | end; |
357 | end; |
367 | end; |
358 | 368 | ||
Line 378... | Line 388... | ||
378 | begin |
388 | begin |
379 | TasksListViewDblClick(Sender); |
389 | TasksListViewDblClick(Sender); |
380 | end; |
390 | end; |
381 | end; |
391 | end; |
382 | 392 | ||
383 | procedure TUD2MainForm.Button1Click(Sender: TObject); |
393 | procedure TUD2MainForm.OpenTDFButtonClick(Sender: TObject); |
384 | var |
394 | var |
385 | cmd: TUD2Command; |
395 | cmd: TUD2Command; |
386 | begin |
396 | begin |
387 | cmd.executable := ud2.IniFileName; |
397 | cmd.executable := ud2.IniFileName; |
388 | cmd.runAsAdmin := false; |
398 | cmd.runAsAdmin := false; |
389 | cmd.runInOwnDirectory := false; |
399 | cmd.runInOwnDirectory := false; |
390 | cmd.windowMode := SW_NORMAL; |
400 | cmd.windowMode := SW_NORMAL; |
391 | UD2_RunCMD(cmd); |
401 | UD2_RunCMD(cmd); |
392 | end; |
402 | end; |
393 | 403 | ||
394 | procedure TUD2MainForm.Button2Click(Sender: TObject); |
404 | procedure TUD2MainForm.SaveTDFButtonClick(Sender: TObject); |
395 | begin |
405 | begin |
396 | if CompatSaveDialogExecute(SaveDialog1) then |
406 | if CompatSaveDialogExecute(SaveDialog1) then |
397 | begin |
407 | begin |
398 | IniTemplateMemo.Lines.SaveToFile(SaveDialog1.FileName); |
408 | IniTemplateMemo.Lines.SaveToFile(SaveDialog1.FileName); |
399 | end; |
409 | end; |
Line 559... | Line 569... | ||
559 | begin |
569 | begin |
560 | LoadTaskList; |
570 | LoadTaskList; |
561 | LoadDetectedIDs; |
571 | LoadDetectedIDs; |
562 | LoadINITemplate; |
572 | LoadINITemplate; |
563 | LoadLoadedPluginList; |
573 | LoadLoadedPluginList; |
- | 574 | LoadDynamicPluginList; |
|
564 | CheckForErrors; |
575 | CheckForErrors; |
565 | 576 | ||
566 | Visible := true; |
577 | Visible := true; |
567 | Exit; |
578 | Exit; |
568 | end; |
579 | end; |
Line 572... | Line 583... | ||
572 | begin |
583 | begin |
573 | // To avoid accidental change of the default tab from the IDE VCL Designer |
584 | // To avoid accidental change of the default tab from the IDE VCL Designer |
574 | PageControl1.ActivePage := TasksTabSheet; |
585 | PageControl1.ActivePage := TasksTabSheet; |
575 | end; |
586 | end; |
576 | 587 | ||
577 | procedure TUD2MainForm.Button5Click(Sender: TObject); |
588 | procedure TUD2MainForm.DynamicTestButtonClick(Sender: TObject); |
578 | var |
589 | var |
579 | idTerm: string; |
590 | p: TUD2Plugin; |
580 | cmds: TUD2CommandArray; |
591 | x: TArrayOfString; |
581 | sCmds: string; |
592 | newStuff: boolean; |
582 | i: integer; |
593 | resourcestring |
- | 594 | LNG_DETECTED_DYNAMICS = 'The plugin returns following identification strings:'; |
|
583 | begin |
595 | begin |
584 | // TODO xxx: Auch eine Möglichkeit geben, einfach nur "Testecho(abc)" einzugeben und es kommt was bei raus |
- | |
585 | - | ||
586 | if InputQuery('Enter example term', 'Example: Testecho(abc):abc=calc.exe', idTerm) then |
596 | if DynamicTestPluginComboBox.ItemIndex = -1 then |
587 | begin |
597 | begin |
- | 598 | ShowMessage('Please select a plugin that is accepting dynamic requests.'); |
|
588 | SetLength(cmds, 0); |
599 | exit; |
589 | cmds := ud2.CheckTerm(idTerm); |
600 | end; |
590 | 601 | ||
- | 602 | p := DynamicTestPluginComboBox.Items.Objects[DynamicTestPluginComboBox.ItemIndex] as TUD2Plugin; |
|
- | 603 | ||
- | 604 | newStuff := p.InvokeDynamicCheck(DynamicTestDataEdit.Text, x); |
|
591 | sCmds := ''; |
605 | |
- | 606 | showmessage(LNG_DETECTED_DYNAMICS + #13#10#13#10 + MergeString(x, #13#10)); |
|
- | 607 | ||
592 | for i := Low(cmds) to High(cmds) do |
608 | if newStuff then |
593 | begin |
609 | begin |
594 | sCmds := sCmds + cmds[i].executable + #13#10; |
610 | LoadDetectedIDs; |
- | 611 | LoadINITemplate; |
|
- | 612 | end; |
|
595 | end; |
613 | end; |
596 | 614 | ||
- | 615 | procedure TUD2MainForm.LoadDynamicPluginList; |
|
- | 616 | var |
|
- | 617 | i: integer; |
|
- | 618 | p: TUD2Plugin; |
|
- | 619 | begin |
|
597 | if Length(cmds) = 0 then |
620 | for i := 0 to ud2.LoadedPlugins.Count-1 do |
- | 621 | begin |
|
598 | ShowMessage('No commands would be executed.') |
622 | p := ud2.LoadedPlugins.Items[i] as TUD2Plugin; |
- | 623 | if p.AcceptsDynamicRequests then |
|
599 | else |
624 | begin |
600 | showmessage('Following commands would be executed:' + #13#10#13#10 + sCmds); |
625 | DynamicTestPluginComboBox.Items.AddObject(p.PluginName, p); |
- | 626 | end; |
|
601 | end; |
627 | end; |
602 | LoadDetectedIDs; |
- | |
603 | end; |
628 | end; |
604 | 629 | ||
605 | end. |
630 | end. |