добавил обработку таймеров и сами таймеры в автоматические действия

This commit is contained in:
PC1\PTyTb
2025-08-08 01:49:45 +03:00
parent 7d9eaaac4e
commit f2c012dd28
12 changed files with 500 additions and 71 deletions
+28 -21
View File
@@ -8,7 +8,8 @@ uses
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.TabControl,
FMX.Controls.Presentation, FMX.StdCtrls, System.ImageList, FMX.ImgList,
FMX.Styles, ShellAPI, StrUtils,
fSettings, fAI, fNotify, fAutoActions, FMX.ListBox, fLog, uRecords,
fSettings, fAI, fNotify, fAutoActions, FMX.ListBox, fLog, uMyTimer, uRecords,
System.Generics.Collections,
System.IOUtils, fCommands, uDataBase, FMX.Edit, FMX.Colors, FMX.SpinBox,
windows, System.Skia, FMX.Skia, uCreateChat, uCreateNotify, fOBS;
@@ -133,6 +134,7 @@ begin
myConst.cfg1 := myConst.GeneralPath + 'botapp.cfg';
db := TSettingsDatabase.Create(myConst.DBPath);
frAutoActions1.FTimerList := TObjectList<TMyTimerThread>.Create(false);
ReadDB;
frCommands1.frsgSounds.ObjectRecord := frCommands1.listSounds;
frCommands1.frsgSounds.TableName := 'listSounds';
@@ -252,11 +254,6 @@ var
db.LoadRecordArray<TListCommands>('listCommands', frCommands1.listCommands);
frCommands1.UpdateGridFromArray;
db.LoadRecordArray<TOBSChat>('listChats', frOBS1.listChats);
db.LoadRecordArray<TOBSNotify>('listNotify', frOBS1.listNotify);
db.LoadRecordArray<TOBSKandinsky>('listKandinsky', frOBS1.listKandinsky);
frOBS1.UpdateGridFromArray;
end;
// Çàãðóçêà ñïèñêà ãðóïï
@@ -352,11 +349,11 @@ var
frAI1.rbGC.IsChecked := True;
frAI1.Label45.text := 'ClientID';
frAI1.Label47.text := 'Autorization Code';
frAI1.Label1.Visible := False;
frAI1.Label1.Visible := false;
frAI1.edtAIP2.Visible := True;
frAI1.edtAIP2.Password := True;
frAI1.edtAIP3.Visible := False;
frAI1.cbOllama.Visible := False;
frAI1.edtAIP3.Visible := false;
frAI1.cbOllama.Visible := false;
end;
// Íàñòðîéêè DeepSeek
@@ -365,10 +362,10 @@ var
frAI1.rbDS.IsChecked := True;
frAI1.Label45.text := 'API Token';
frAI1.Label47.text := '';
frAI1.Label1.Visible := False;
frAI1.edtAIP2.Visible := False;
frAI1.edtAIP3.Visible := False;
frAI1.cbOllama.Visible := False;
frAI1.Label1.Visible := false;
frAI1.edtAIP2.Visible := false;
frAI1.edtAIP3.Visible := false;
frAI1.cbOllama.Visible := false;
end;
// Íàñòðîéêè ChatGPT
@@ -377,10 +374,10 @@ var
frAI1.rbCG.IsChecked := True;
frAI1.Label45.text := 'API Token';
frAI1.Label47.text := '';
frAI1.Label1.Visible := False;
frAI1.edtAIP2.Visible := False;
frAI1.edtAIP3.Visible := False;
frAI1.cbOllama.Visible := False;
frAI1.Label1.Visible := false;
frAI1.edtAIP2.Visible := false;
frAI1.edtAIP3.Visible := false;
frAI1.cbOllama.Visible := false;
end;
// Íàñòðîéêè êàñòîìíîãî ÈÈ
@@ -391,7 +388,7 @@ var
frAI1.Label47.text := 'URL';
frAI1.Label1.Visible := True;
frAI1.edtAIP2.Visible := True;
frAI1.edtAIP2.Password := False;
frAI1.edtAIP2.Password := false;
frAI1.edtAIP3.Visible := True;
frAI1.cbOllama.Visible := True;
frAI1.cbOllama.IsChecked := db.ReadSetting(frAI1.cbOllama.Name) = '1';
@@ -425,9 +422,18 @@ var
// Çàãðóçêà ãðèäîâ àâòîìàòè÷åñêèõ äåéñòâèé
procedure LoadAutoActionsGrids;
begin
db.LoadGridFromTable('sgTimers', frAutoActions1.sgTimers);
db.LoadGridFromTable('sgCounter', frAutoActions1.sgCounter);
db.LoadGridFromTable('sgBanWords', frAutoActions1.sgBanWords);
db.LoadRecordArray<TListTimer>('listTimer', frAutoActions1.listTimer);
frAutoActions1.initTimers;
frAutoActions1.UpdateGridFromArray;
end;
// Çàãðóçêà èíòåãðàöèé ñ ÎÁÑ
procedure LoadOBSGrids;
begin
db.LoadRecordArray<TOBSChat>('listChats', frOBS1.listChats);
db.LoadRecordArray<TOBSNotify>('listNotify', frOBS1.listNotify);
db.LoadRecordArray<TOBSKandinsky>('listKandinsky', frOBS1.listKandinsky);
frOBS1.UpdateGridFromArray;
end;
begin
@@ -438,6 +444,7 @@ begin
LoadNotifySettings;
LoadAISettings;
LoadOBSGrids;
LoadAutoActionsGrids;
end;