Jump to content

Pat Foley

Members
  • Content Count

    412
  • Joined

  • Last visited

  • Days Won

    2

Pat Foley last won the day on August 9 2023

Pat Foley had the most liked content!

Community Reputation

53 Excellent

1 Follower

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

10240 profile views
  1. Pat Foley

    Modern StandBy

    Here's my logger I had suspected some issue with timer restarting I wrapped the timer event to disable the timer when in the event seemed to help and removed a show event on the logging form seemed to have fixed. The following sleep states are available on this system: //Pats win 11 pro Standby (S0 Low Power Idle) Network Connected Hibernate Fast Startup The following sleep states are not available on this system: Standby (S1) The system firmware does not support this standby state. This standby state is disabled when S0 low power idle is supported. Standby (S2) The system firmware does not support this standby state. This standby state is disabled when S0 low power idle is supported. Standby (S3) This standby state is disabled when S0 low power idle is supported. Hybrid Sleep Standby (S3) is not available. The hypervisor does not support this standby state. //Events app1 sidebar memoShowMessages h18.834 ZeroIndex 985940 Comp 199704 18.835 TSideBar on top//1 18.838 Shell_TrayWnd on top // closing logged on App1 18.858 Windows.UI.Core.CoreWindow on top//opening App1 18.861 LockScreenControllerProxyWindow on top 18.861 Shell_TrayWnd on top 18.864 TSideBar on top //events Second running App sidebar memoShowMessages 18.826 TSideBar on top 18.827 CabinetWClass on top 18.829 Shell_TrayWnd on top 18.834 on top 18.834 TSideBar on top //1 18.838 Shell_TrayWnd on top// closing logged on App2 18.858 on top 18.859 Windows.UI.Core.CoreWindow on top//opening logged on App2 18.861 LockScreenControllerProxyWindow on top 18.861 Shell_TrayWnd on top 18.864 TSideBar on top // made with this coding var TopWinControl: HWND; procedure TSideBar.TaskTimerTimer(Sender: TObject); const MAX_VALUE = 255; var pcClassName: Array [0 .. MAX_VALUE] Of Char; aClassName: string; Hnd: HWND; begin TaskTimer.Enabled := False; Hnd := GetForegroundWindow; // shows apps being used. if Hnd <> TopWinControl then begin TopWinControl := Hnd; GetClassName(Hnd, pcClassName, MAX_VALUE); aClassName := Trim(pcClassName); label1.Caption := aClassName; memoShowMessages.Lines.add(format('%2.3f %s on top', [Time * 24, aClassName]));//Screen.Forms[0].Name]); end; // show now can change bringtofront getfocus best not use here //boo 100xs Jumper.Show; // not needed and perhaps fighting the debugger TaskTimer.Enabled := True; end; Needs to be 64 bit.
  2. No Too much new stuff just I was switching to use bootstrap now they switched to CSS and "pseudo" buttons or maybe SVG based components in Laz. This use of Generics to hook up the tags in the IC to controls needs perhaps needs 500 words to describe the how and the why for it. No excuse for multiple seat reference when OP mentioned desktop though.
  3. One. Generics allow the tags to be quickly set to the Sims IC initial conditions, adjusted with the various faceplates and output to the UI chart and legends. as so TsimUIout = Record faceplate: Tform; Controller:Tsimcontroller; Value: Pdouble; Span, Min: Integer; end; procedure Update; Compute; var UIstuff := TList<^TmyUIout>; for var ui in UIstuff do update; end; Two. Use a transpiler pas2js can emit JS that runs on a browser. Three. Value = validity, number of seats , subject matter. If the simulator can increase interaction and communication between the crew members during training-- knowledge transfer plus teamwork can happen 🙂
  4. Much of the roadmap should include reticulation of the system you are modeling. Bond graphs allow cause effect, modular construction, and the relationship between the domains to be surfaced with causal strokes the bonds (effort vs flow) are drawn . To avoid paying 20 K to Twente sim, I draw the system out in bound book. these drawings help in connecting sources to sinks. A book on bond graphs mentioned that eigenvalue would be easier to understand written as characteristic wert. 🙂 Delphi to Laz. // in lpr was dpr {$IFDEF FPC} {$MODE Delphi}// saves using specialize in generic constructs {$ENDIF} uses {$IFnDEF FPC} {$ELSE} Interfaces, // lets the laz work {$ENDIF}
  5. Pat Foley

    Making both vertical axis visible at all times in TeeChart

    I found this This one works well. Thank you pep. at http://teechart.net/support/viewtopic.php?t=4313
  6. Pat Foley

    Resizing themed form to fit title caption

    2. May need to review how the opendialog uses style in the source then. I am running 12.2 but next year will test some stuff with 10.2 win 7 and will compare the source 3. Pix shows showmessage with and without style.
  7. Pat Foley

    Resizing themed form to fit title caption

    1. put a "banner" on the form say a tpanel and get the textextent of its caption there. use to set bounds of form add in 20*button count and be done. 2. Look at TMessageForm in Vcl.dialogs source that shows how team Emba does it. Time ~ 3 hours. 3. Pix shows windows dialog vs a TmessageForm. (arrows point out differences in needing different code to view classtype of dialogs when not using style this is 12.2 though.)
  8. How are the () implemented then are they to be implied? procedure X(i: Integer); begin end; procedure Y; begin var f: TFunc<Integer>; //X(f); You need give the compiler a "Clue" X(f()); //runs //(procedure begin Beep; end); Boo (procedure begin Beep; end) (); //Yay! //In VBA need use either Call or add (); 'To even add a line of code. end;
  9. Pat Foley

    Insert an save item in ComboEdit at first position

    What keys or click did you use to connect the append. Under windows code seems to add a line when tabbed? // if you wire up onClick In Events in Object Inspector procedure TForm13.ComboEdit1Click(Sender: TObject); begin if Sender is TComboEdit then begin var CE := Sender as TComboEdit; CE.Items.Insert(0, CE.text); //CE.Items.add(CE.Text); //CE.Items.Insert(CE.Items.Count, CE.text); CE.Text := ''; //clears for newline end; end;
  10. Pat Foley

    One line of code not quite right

    I thought Remy mentioned using Add with a memo control. Here is a Sample using a nested procedure and a procedure with arguments that pass in controls that update the UI as needed. This sample uses both Format and ToString to help show the logic in the Controls as the program runs. implementation {$R *.dfm} const BooleanOperators: TArray<string> = ['And', 'or', 'xor','NotAnd','NotOr']; var A, B, RC: Boolean; procedure TForm13.Button1Click(Sender: TObject); begin A := True; B := True; // filter the controls props here use nil or '' if control or string not made yet demo357Repair(Memo1.Lines, Listbox1.Items, nil, A, B); end; { TForm13 } /// <summary> /// The TStrings of TMEMO are passed and requires a Memo1 and a Listbox1 to work /// /// </summary> procedure TForm13.Demo357Repair(const memoStrs, lbAItems, lbBItems : TStrings;var argA,argB: Boolean); // this flyover updates the value of RC each pass // how would you update A each time function flyoverCase(const Idx: NativeInt): Boolean; begin case Idx of 0: Result := argA and argB; 1: Result := argA or argB; 2: Result := argA xor argB; 3: Result := not argA or argB; // adjust these to suit your schema 4: Result := argA and not argB; else begin Result := False; memoStrs.Add('flyover needs attention');//surface errors end; end; // A := Result; // UX = User outputs memoStrs.Add( Format('%2s = %2s %s %2s', [RC.toString, argA.ToString(True), BooleanOperators[Idx], ArgB.ToString(False)]) ); lbAItems.Add(RC.ToString); //how would you connect lbBItems end; begin for var I := Low(BooleanOperators) to High(booleanOperators) do RC := flyoverCase(I); end;
  11. Pat Foley

    Delphi 12.2 Toolbars strange behavior

    I like the extra one or two code lines showing gained by not showing them. If only the debug pause button had a key.
  12. procedure TForm1.Button1Click(Sender: TObject); begin 1 2 -- debugging started via F8. 3 4 5 6 7 -- stop debugging after this. so if i press F8, debugging will not continue to step past it 7. // move to end 8 9 end;// <== put break point here to stop loading the next block or unit use F9 to resume or f7 to enter By putting a trap at the end lets you use F9 to advance to trap to either move to next routine or F9 to run. As the program is debugged these traps are last to remove.
  13. Pat Foley

    Component property disappears from DFM

    Does baseform have the onMyEvent assigned to empty event simply a frameclick(Sender:TObject)begin..end? doing that allows the inherited form a stub to hook up its event.
  14. Pat Foley

    Switching off automatic Bookmarks?

    The feature I like best is the time loading metric when starting the IDE... Mostly the reading is 1728 if the reading is above 22xx I will restart the IDE several times to freshen the OS file MRUs/caches. When the reading was 65xxx the machine was having a quota issue*. It would interesting to compare MMX load time on different machines. The tip of the day, refactor with and link-analyzer are used or useful. Thanks for providing it. *Edge died off then and only D12 ran albeit no Co-Pilot . The next months windows update fixed the issue.
  15. Pat Foley

    Packages and Package structure

    I had had some luck following these rules. Place only mature controls in the palette. If a control coding is changed just select Install that seems to tell the IDE to do the right thing. Needs to be 32 bit to see install. Any existing control needs removed from the designer view with ctrl X and the control gets the update as it pasted back in. This saves restarting the IDE. Check the path of control ensure that it's codebase made the trip to 290 and not using a control that using a 11 or 280 codebase. Have a sub project that allows the custom controls and forms to be compiled as standalone allowing modular construction getting custom controls working. then the main project uses the forms that have the controls placed on them.
×