[SSE] Show trial solver solution dialog

This commit is contained in:
Julia.Radzhabova
2025-11-18 19:34:56 +03:00
parent ca31b597c8
commit 206e99d8a3
2 changed files with 43 additions and 2 deletions

View File

@ -69,6 +69,7 @@ define([
this.api.asc_registerCallback('asc_onGoalSeekUpdate', _.bind(this.onUpdateGoalSeekStatus, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onSolverResultDlgOpen',_.bind(this.onSolverResultDlgOpen, this));
this.api.asc_registerCallback('asc_onSolverTrialDlgOpen',_.bind(this.onSolverTrialDlgOpen, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('protect:wslock', _.bind(this.onChangeProtectSheet, this));
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
@ -535,6 +536,40 @@ define([
win.setSettings(id);
},
onSolverTrialDlgOpen: function(id) {
var me = this,
msg;
switch (id) {
case AscCommonExcel.c_oAscResultStatus.maxIterationsReached:
msg = this.txtMaxIterations;
break;
case AscCommonExcel.c_oAscResultStatus.maxTimeReached:
msg = this.txtMaxTime;
break;
case AscCommonExcel.c_oAscResultStatus.maxFeasibleSolutionReached:
msg = this.txtMaxFeasible;
break;
case AscCommonExcel.c_oAscResultStatus.maxSubproblemSolutionReached:
msg = this.txtMaxSubproblem;
break;
}
msg && Common.UI.alert({
title: this.txtTrialSolution,
msg: msg,
buttons: [{
value: 'ok',
caption: this.txtContinue
}, {
value: 'cancel',
caption: this.txtStop
}],
primary: 'ok',
callback: function (btn) {
(btn === 'cancel') ? me.api.asc_StopSolver() : me.api.asc_StepSolver();
}
});
},
onUpdateGoalSeekStatus: function (targetValue, currentValue, iteration, cellName) {
var me = this;
if (!this.GoalSeekStatusDlg) {

View File

@ -912,6 +912,13 @@
"SSE.Controllers.DataTab.txtRemoveDataValidation": "The selection contains more than one type of validation.<br>Erase current settings and continue?",
"SSE.Controllers.DataTab.txtRemSelected": "Remove in selected",
"SSE.Controllers.DataTab.txtUrlTitle": "Paste a data URL",
"SSE.Controllers.DataTab.txtTrialSolution": "Show trial solution",
"SSE.Controllers.DataTab.txtContinue": "Continue",
"SSE.Controllers.DataTab.txtStop": "Stop",
"SSE.Controllers.DataTab.txtMaxIterations": "The maximum iteration limit was reached. Continue anyway?",
"SSE.Controllers.DataTab.txtMaxTime": "The maximum time limit was reached. Continue anyway?",
"SSE.Controllers.DataTab.txtMaxFeasible": "The maximum number of feasible solutions was reached. Continue anyway?",
"SSE.Controllers.DataTab.txtMaxSubproblem": "The maximum number of subproblems was reached. Continue anyway?",
"SSE.Controllers.DocumentHolder.alignmentText": "Alignment",
"SSE.Controllers.DocumentHolder.centerText": "Center",
"SSE.Controllers.DocumentHolder.deleteColumnText": "Delete Column",
@ -4086,6 +4093,7 @@
"SSE.Views.SolverDlg.textBin": "bin",
"SSE.Views.SolverDlg.textDif": "dif",
"SSE.Views.SolverDlg.textMustContainFormula": "The cell must contain a formula",
"SSE.Views.SolverDlg.textManyVarCells": "Too many Variable Cells",
"SSE.Views.SolverMethodDialog.txtTitle": "Method options",
"SSE.Views.SolverMethodDialog.txtPrecision": "Constraint precision",
"SSE.Views.SolverMethodDialog.txtAutoScale": "Use automatic scaling",
@ -4117,8 +4125,6 @@
"SSE.Views.SolverResultsDlg.txtStoppedDesc": "Solver has stopped before finding a globally optimal solution. The best found solution, if any, will be given.",
"SSE.Views.SolverResultsDlg.txtLineConditions": "The linearity conditions required by this LP Solver are not satisfied.",
"SSE.Views.SolverResultsDlg.txtLineConditionsDesc": "Create a linearity report to see where the problem is, or switch to the GRG engine.",
"SSE.Views.SolverResultsDlg.txtTooLarge": "The problem is too large for Solver to handle.",
"SSE.Views.SolverResultsDlg.txtTooLargeDesc": "",
"SSE.Views.SolverResultsDlg.txtErrorVal": "Solver encountered an error value in the Objective Cell or a Constraint cell.",
"SSE.Views.SolverResultsDlg.txtErrorValDesc": "One of the cells in the worksheet became an error value when Solver tried certain values for the Variable Cells.",
"SSE.Views.SolverResultsDlg.txtNotEnoughMemory": "There is not enough memory available to solve the problem.",