mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-23 15:48:10 +00:00
Chart Commands:
- ChartSaveTemplate Implemented
This commit is contained in:
+38
-4
@@ -719,13 +719,19 @@ int executeCommand()
|
||||
case 245: //ChartFirst
|
||||
Execute_ChartSymbol();
|
||||
break;
|
||||
case 236: //ChartApplyTemplate
|
||||
Execute_ChartApplyTemplate();
|
||||
break;
|
||||
case 252: //ChartGetString
|
||||
Execute_ChartGetString();
|
||||
break;
|
||||
|
||||
case 236: //ChartApplyTemplate
|
||||
Execute_ChartApplyTemplate();
|
||||
break;
|
||||
|
||||
case 237: //ChartApplyTemplate
|
||||
Execute_ChartSaveTemplate();
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 153: //TerminalInfoString
|
||||
Execute_TerminalInfoString();
|
||||
@@ -6155,7 +6161,6 @@ void Execute_ChartApplyTemplate()
|
||||
return;
|
||||
}
|
||||
StringReplace(TemplateFileName, "\\", "\\\\");
|
||||
ResetLastError();
|
||||
|
||||
if (!sendBooleanResponse(ExpertHandle, ChartApplyTemplate(ChartId, TemplateFileName), _response_error))
|
||||
{
|
||||
@@ -6164,6 +6169,35 @@ void Execute_ChartApplyTemplate()
|
||||
ChartRedraw(ChartId);
|
||||
}
|
||||
|
||||
void Execute_ChartSaveTemplate()
|
||||
{
|
||||
long ChartId;
|
||||
string TemplateFileName;
|
||||
StringInit(TemplateFileName, 100, 0);
|
||||
|
||||
|
||||
if (!getLongValue(ExpertHandle, 0, ChartId, _error))
|
||||
{
|
||||
PrintParamError("ChartSaveTemplate", "ChartId", _error);
|
||||
sendErrorResponse(ExpertHandle, -1, _error, _response_error);
|
||||
return;
|
||||
}
|
||||
if (!getStringValue(ExpertHandle, 1, TemplateFileName, _error))
|
||||
{
|
||||
PrintParamError("ChartSaveTemplate", "TemplateFileName", _error);
|
||||
sendErrorResponse(ExpertHandle, -1, _error, _response_error);
|
||||
return;
|
||||
}
|
||||
StringReplace(TemplateFileName, "\\", "\\\\");
|
||||
|
||||
if (!sendBooleanResponse(ExpertHandle, ChartSaveTemplate(ChartId, TemplateFileName), _response_error))
|
||||
{
|
||||
PrintResponseError("ChartSaveTemplate", _response_error);
|
||||
}
|
||||
ChartRedraw(ChartId);
|
||||
}
|
||||
|
||||
|
||||
void Execute_ChartGetString()
|
||||
{
|
||||
long ChartId;
|
||||
|
||||
Reference in New Issue
Block a user