Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Main/AssetUtil.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ LoadMainSetting() {
MySoftData.IsBootStart := IniRead(IniFile, IniSection, "IsBootStart", false)
MySoftData.ShowSplitLine := IniRead(IniFile, IniSection, "ShowSplitLine", false)
MySoftData.FixedMenuWheel := IniRead(IniFile, IniSection, "FixedMenuWheel", false)
MySoftData.MutiThreadNum := IniRead(IniFile, IniSection, "MutiThreadNum", 3)
MySoftData.MutiThreadNum := IniRead(IniFile, IniSection, "MutiThreadNum", 3)
MySoftData.DynamicCorePoolSize := IniRead(IniFile, IniSection, "DynamicCorePoolSize", 1)
MySoftData.ElasticTimeout := IniRead(IniFile, IniSection, "ElasticTimeout", 30)
MySoftData.SoftBGColor := IniRead(IniFile, IniSection, "SoftBGColor", "f0f0f0")
MySoftData.NoVariableTip := IniRead(IniFile, IniSection, "NoVariableTip", true)
MySoftData.CMDTip := IniRead(IniFile, IniSection, "CMDTip", false)
Expand Down
25 changes: 14 additions & 11 deletions Main/BindUtil.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -664,12 +664,14 @@ OnToggleTriggerMacro(tableIndex, itemIndex) {
hasWorker := MyWorkPool.CheckHasFreeWorker()

if (hasWorker) {
SetTableItemState(tableItem.index, itemIndex, 1)
workerPath := MyWorkPool.Get()
workerIndex := MyWorkPool.GetWorkIndex(workerPath)
tableItem.IsWorkIndexArr[itemIndex] := workerIndex
MyWorkPool.PostMessage(WM_TR_MACRO, workerPath, tableIndex, itemIndex)
return
if (workerPath != "") {
SetTableItemState(tableItem.index, itemIndex, 1)
workerIndex := MyWorkPool.GetWorkIndex(workerPath)
tableItem.IsWorkIndexArr[itemIndex] := workerIndex
MyWorkPool.PostMessage(WM_TR_MACRO, workerPath, tableIndex, itemIndex)
return
}
}

isTrigger := tableItem.ToggleStateArr[itemIndex]
Expand Down Expand Up @@ -701,11 +703,12 @@ TriggerMacroHandler(tableIndex, itemIndex, *) {
SetTableItemState(tableItem.index, itemIndex, 1)
if (hasWork) {
workPath := MyWorkPool.Get()
workIndex := MyWorkPool.GetWorkIndex(workPath)
tableItem.IsWorkIndexArr[itemIndex] := workIndex
MyWorkPool.PostMessage(WM_TR_MACRO, workPath, tableIndex, itemIndex)
}
else {
OnTriggerMacroKeyAndInit(tableItem, macro, itemIndex)
if (workPath != "") {
workIndex := MyWorkPool.GetWorkIndex(workPath)
tableItem.IsWorkIndexArr[itemIndex] := workIndex
MyWorkPool.PostMessage(WM_TR_MACRO, workPath, tableIndex, itemIndex)
return
}
}
OnTriggerMacroKeyAndInit(tableItem, macro, itemIndex)
}
4 changes: 3 additions & 1 deletion Main/DataClass.Ahk
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ class SoftData {
this.FixedMenuWheel := false ;固定菜单轮
this.NoVariableTip := false ;无变量提醒
this.ScreenShotType := 3 ;截图类型
this.MutiThreadNum := 3 ;多线程数
this.MutiThreadNum := 3 ;多线程数(-1动态)
this.DynamicCorePoolSize := 1 ;动态模式核心池大小
this.ElasticTimeout := 30 ;弹性Worker超时(秒)
this.IsSuspend := false ;休眠
this.SuspendHotkey := "" ;休眠快捷键
this.IsPause := false ;暂停
Expand Down
54 changes: 27 additions & 27 deletions Main/RMTUtil.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ SetGlobalArray(Name, Value) {
MyVarListenGui.Refresh()
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
MyWorkPool.SendMessage(WM_COPYDATA, workPath, CMDStr)
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], CMDStr)
}
}
}
Expand All @@ -322,9 +322,9 @@ CloneGlobalArray(SourceArr, NewArrName) {
MyVarListenGui.Refresh()
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
MyWorkPool.SendMessage(WM_COPYDATA, workPath, CMDStr)
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], CMDStr)
}
}
}
Expand All @@ -335,9 +335,9 @@ DeleteGlobalArray(ArrName) {
MyVarListenGui.Refresh()
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
MyWorkPool.SendMessage(WM_COPYDATA, workPath, CMDStr)
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], CMDStr)
}
}
}
Expand All @@ -350,9 +350,9 @@ ModifyGlobalArray(ArrName, MainIndex, Index, IsArrayValue, Value) {
MyVarListenGui.Refresh()
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
MyWorkPool.SendMessage(WM_COPYDATA, workPath, CMDStr)
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], CMDStr)
}
}
}
Expand All @@ -365,9 +365,9 @@ InsertGlobalArray(ArrName, MainIndex, Index, IsArrayValue, Value) {
MyVarListenGui.Refresh()
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
MyWorkPool.SendMessage(WM_COPYDATA, workPath, CMDStr)
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], CMDStr)
}
}
}
Expand All @@ -379,9 +379,9 @@ RemoveAtGlobalArray(ArrName, MainIndex, Index) {
MyVarListenGui.Refresh()
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
MyWorkPool.SendMessage(WM_COPYDATA, workPath, CMDStr)
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], CMDStr)
}
}
}
Expand Down Expand Up @@ -410,9 +410,9 @@ SetGlobalVariable(NameArr, ValueArr, ignoreExist) {
MyVarListenGui.Refresh()
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
MyWorkPool.SendMessage(WM_COPYDATA, workPath, NameValueCMDStr)
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], NameValueCMDStr)
}
}
}
Expand All @@ -434,20 +434,20 @@ DelGlobalVariable(NameArr) {
MyVarListenGui.Refresh()
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
MyWorkPool.SendMessage(WM_COPYDATA, workPath, NameValueCMDStr)
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], NameValueCMDStr)
}
}
}

SetCMDTipValue(value) {
IsMuti := MyWorkPool.CheckEnableMutiThread()
if (IsMuti) {
loop MyWorkPool.maxSize {
workPath := A_ScriptDir "\Thread\Work" A_Index ".exe"
workerList := MyWorkPool.GetActiveWorkerList()
loop workerList.Length {
str := Format("CMDTip_{}", value)
MyWorkPool.SendMessage(WM_COPYDATA, workPath, str)
MyWorkPool.SendMessage(WM_COPYDATA, workerList[A_Index], str)
}
}
}
Expand Down
15 changes: 12 additions & 3 deletions Main/UIUtil.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,20 @@ AddSettingUI(index) {
tableItem)
MySoftData.CoordYFloatCon := con

AddTableControl("Text", Format("x{} y{}", posX + 635, posY), GetLang("多线程数(0~10):"), tableItem)
con := AddTableControl("Edit", Format("x{} y{} w100 center", posX + 760, posY - 4), MySoftData.MutiThreadNum,
tableItem)
AddTableControl("Text", Format("x{} y{}", posX + 635, posY), GetLang("多线程数(-1~10):"), tableItem)
con := AddTableControl("Edit", Format("x{} y{} w100 center", posX + 760, posY - 4), MySoftData.MutiThreadNum, tableItem)
MySoftData.MutiThreadNumCtrl := con

; posY += 40
; AddTableControl("Text", Format("x{} y{}", posX + 635, posY), GetLang("核心池大小(1~10):"), tableItem)
; con := AddTableControl("Edit", Format("x{} y{} w100 center", posX + 760, posY - 4), MySoftData.DynamicCorePoolSize, tableItem)
; MySoftData.DynamicCorePoolSizeCtrl := con

; posY += 40
; AddTableControl("Text", Format("x{} y{}", posX + 635, posY), GetLang("弹性超时(秒):"), tableItem)
; con := AddTableControl("Edit", Format("x{} y{} w100 center", posX + 760, posY - 4), MySoftData.ElasticTimeout, tableItem)
; MySoftData.ElasticTimeoutCtrl := con

posY += 40
AddTableControl("Text", Format("x{} y{}", posX + 25, posY), GetLang("软件背景颜色:"), tableItem)
con := AddTableControl("Edit", Format("x{} y{} w100 center", posX + 145, posY - 4), MySoftData.SoftBGColor,
Expand Down
Loading