Jump to content

Epo

Members
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Epo

    Interface question

    Delphi in a nutshell - Ray Lischner - Nutshell.pas
  2. Hi, Using the VirtualTreeView, an error is raised but why ?. I have recreated a minimal sample to reproduce it. Either my coding does an error (more likely), either the component do it. The problem comes when a node is deleted (only when the deleted node has one sibbling with subnodes) from the OnGetImageIndex event. The event is called with an index greater than avalaible nodes. If someone has an idea ? Delphi 11 + VirtualTree for VCL 2021.09. Thanks a lot, Eddy TestVclVT.zip
  3. Effectively, the ' " ' was missing. And it does the trick. Thank Dany,
  4. Hi, How can I do to bind -e.g. the color of- a shape (set on each line of a DataBand) with a field of the current line of dataset. I have tried to use the event "OnBeforePrint" (of the DataBand and of the object itself) but it does not work. Maybe it is the field access that is not correct. Thank for help, Eddy procedure DataBandOnBeforePrint(Sender: TfrxComponent); begin if <Sample.CFRStatus> = '0' then shCFR.Visible := False else begin shCFR.Visible := True; if <Sample.CFRStatus> = '2' then shCFR.Color := clRed else if <Sample.CFRStatus> = '1' then shCFR.Color := clGreen; end; end; procedure shCFROnBeforePrint(Sender: TfrxComponent); begin if <Sample.CFRStatus> = '0' then shCFR.Visible := False else begin shCFR.Visible := True; if <Sample.CFRStatus> = '2' then shCFR.Color := clRed else if <Sample.CFRStatus> = '1' then shCFR.Color := clGreen; end; end;
  5. Thanks for this example. Precisely, I was wondering how to use this version of GroupBy.
  6. The idea is to link nicely a struct to a VStringTree with multiple levels (2/3). To connect the OnGetText to it, the VST gives a node (with an index and parent..Index you known it ). As you write the ElementAt is not very efficient. I suppose that it is better to use a list and some TFunc<> to filter ("GroupBy") one for each key level. And Spring4D has everything you need to do it..
  7. Effectively, not what I want. I thought that this would be a nice (and efficient) solution to associate the result of GroupBy with a VirtualStringTree but from what you write, this is not the case. Thanks for the help and ...Spring4D, Stefan.
  8. Using the GroupBy method, I wonder if it possible to "imbricate" GroupBy in Spring4D to generate a "two levels" tree in one pass Some sort of: var GByData : IEnumerable<IGrouping<string,TVariable>>; GByData2 : IEnumerable<IGrouping<string,TVariable>>; begin GByData := TEnumerable.GroupBy<TVariable, string>(IEnumTV, function (const ASVar: TVariable): string begin Result := ASVar.AppName; end); GByData2 := TEnumerable.GroupBy<TVariable, string>(GByData, function (const ASVar: TVariable): string begin Result := ASVar.PrjName; end); end; Thanks a lot, Eddy
  9. Hi, In testing the function TEnumerable.GroupBy<T, TKey>(const source: IEnumerable<T>; const keySelector: Func<T, TKey>): IEnumerable<IGrouping<TKey, T>> in Spring Version Dev 2021/03/24 and Version 1.2.4, I find that a noticeable difference is present if I am not mistaken. The 3rd listbox (in the associated example) does not have the elements in the same order (and is even incorrect in the dev version- maybe because defered execution) depending on the version. In version 1.2.4, the order is "stable", which is an interesting property from my point of view. Will the behavior of the Dev version be the one adopted in the next version? Thanks, Eddy ITreeData.zip
  10. Epo

    Pipeline questioning

    Yes, of course... (it works) Great thanks for the help and ....the library.
  11. Hi, I want use a pipeline. The only peculiarity is that in the first stage, there is only on item in the input but many in the output collection. But in the stage one, when it insert the first output, the exception 'Adding to completed collection'" occurs. Although the Input.CompleteAdding statement was not sent. Something is wrong certainly but where ? Thanks for help, Eddy Simplified case below (using Delphi 10.4/ Omnithread 3.07.08) procedure TForm1.Button1Click(Sender: TObject); begin PipelineExecute('1,2,3,4,6,10'); end; procedure TForm1.PipelineExecute(const sMes: string); var ppl: IOmniPipeline; Value: TOmniValue; begin ppl := Parallel.Pipeline .Stage(StageOne) .Stage(StageTwo) .run; ppl.Input.Add(sxmlMes); // ppl.Input.CompleteAdding; end; procedure TForm1.StageOne(const input, output: IOmniBlockingCollection); var s: string; OmVal: TOmniValue; arS: TArray<string>; i: Integer; begin input.Take(OmVal); // 0 arS := SplitString(OmVal.AsString,','); for i := 0 to Length(arS) -1 do Output.Add( StrToInt(ars[i])* 2); end; procedure TForm1.StageTwo(const input, output: IOmniBlockingCollection); var i: Integer; OmVal: TOmniValue; begin for OmVal in input do begin //....... output.Add(omval) ; end; end;
  12. Thank you, François. I will test it (probably - others tasks on fire) next week. Eddy
  13. Hi Joseph, Actually, the problem is not SSH itself. OpenSSH works perfectly with scripts (that open a connection, launch a script and close the connection). The goal is to keep an open connection and sends the instructions (and retrieve the outputs - stdout) like manually we can do it at a terminal but from a Delphi program. The open/close actions takes too much time in my case.
  14. Hi, I would like to know if it is possible with the ICS components to open a (remote) terminal SSH session with a linux machine in a Delphi program (on Win 10 e.g.) and to send commands bash (ls, ps, xtodo, ...) and to receive the outputs (to know when the command execute is finished). If so, is there an example or skeleton for this application type ? Thanks a lot, Eddy
×