The Sample program demonstrates the main functionality of the OTX-Runtime API. It can be used as a reference for the expected runtime behavior of the API and the source code below is like a reference guide about the proper programming of the API.
1 #include "SampleForm.h"
2 using namespace OpenTestSystem::Otx::Runtime2::Api::Sample;
5 #include "LicenseForm.h"
6 #include "SampleConstants.h"
7 #include "Util/LicenseUtil.h"
9 #include "CallbackToAction.h"
10 #include "Setting/UserSettings.h"
12 #include "Util/OtxDiagUtil.h"
14 #include "OutputCustomImplementation/BasicScreenOutputImpl.h"
15 #include "OutputCustomImplementation/CommonDialogsOutputImpl.h"
16 #include "OutputCustomImplementation/ContextVariableOutputImpl.h"
17 #include "OutputCustomImplementation/CustomScreenOutputImpl.h"
18 #include "OutputCustomImplementation/ExternalServiceProviderOutputImpl.h"
19 #include "OutputCustomImplementation/I18nOutputImpl.h"
20 #include "OutputCustomImplementation/LoggingOutputImpl.h"
21 #include "OutputCustomImplementation/MeasureOutputImpl.h"
22 #include "OutputCustomImplementation/SqlOutputImpl.h"
23 #include "OutputCustomImplementation/StateVariableOutputImpl.h"
24 using namespace OpenTestSystem::Otx::Runtime2::Api::Sample::OutputCustomImplementation;
26 #include <RuntimeManagerFactory.h>
27 #include <RuntimeConfig.h>
28 #include <License/LicenseManager.h>
29 #include <Project/IProject.h>
30 #include <Project/IPlayerProject.h>
31 #include <IRuntimeContext.h>
32 #include <DiagConnectionState.h>
33 #include <Otx/IProcedureParameter.h>
34 #include <Otx/IProcedureInOutParameter.h>
35 #include <Otx/IProcedureInParameter.h>
36 #include <Otx/IProcedureOutParameter.h>
37 #include <DataTypes/ValueConverter.h>
38 #include <Otx/IContextVariable.h>
39 #include <Otx/IStateVariable.h>
41 #include <Custom/ICustomScreenImplementation.h>
42 #include <DefaultCustomScreenImplementation.h>
43 #include <WpfKeyEventArgs.h>
44 #include <FormKeyEventArgs.h>
45 #include <ContextVariableImplementation.h>
47 #include <StateVariableImplementation.h>
48 #include <DefaultMeasureImplementation.h>
49 #include <DefaultExternalServiceProviderImplementation.h>
51 #include <DataTypes/TranslationKey.h>
52 #include <DataTypes/EnumerationElement.h>
53 #include "Otx/Signature/IEnumerationSignature.h"
56 #include <IDiagConfiguration.h>
58 #include <msclr/auto_gcroot.h>
59 #include <msclr/lock.h>
64 struct OpenTestSystem::Otx::Runtime2::Api::Sample::SampleFormImpl
67 SampleFormImpl(msclr::auto_gcroot<SampleForm^> owner)
71 _ProcedurePending =
nullptr;
72 _ProcedureStarted =
nullptr;
73 _ProcedurePaused =
nullptr;
74 _ProcedureContinued =
nullptr;
75 _ProcedureFinished =
nullptr;
76 _ProcedureStopped =
nullptr;
77 _ProcedureAborted =
nullptr;
78 _ProcedureTimeout =
nullptr;
79 _DiagConnectionStateChanged =
nullptr;
80 _InOutParameterValueChanged =
nullptr;
83 _ContextVariableRead =
nullptr;
85 CreatorForm =
nullptr;
87 WebServerTimer =
nullptr;
89 GlobalRuntimeManager =
nullptr;
90 RuntimeContexts.clear();
91 LockRuntimeContexts =
gcnew System::Object();
92 EventListenerLock =
gcnew System::Object();
93 PrintTextLock =
gcnew System::Object();
95 RuntimeContextIdsExecutionStartTick.clear();
97 ErrorProvider =
nullptr;
100 PlayerProject =
nullptr;
101 ProcedureToExecute =
nullptr;
103 StartUpNode =
nullptr;
105 ProcedureExecutionCount = 0;
107 LastTime = System::DateTime::Now;
109 Title = SampleConstants::MAIN_INSTANCE_NAME;
111 UseConnectionState =
false;
113 IsPathChanging =
false;
117 DefaultDiagPort = SampleConstants::DEFAULT_DM_PORT;
118 DefaultRuntimePort = SampleConstants::DEFAULT_RT_PORT;
119 DefaultDiagPipeName = SampleConstants::DEFAULT_DM_PIPE_NAME;
120 DefaultRuntimePipeName = SampleConstants::DEFAULT_RT_PIPE_NAME;
122 IsStartWebSever = -1;
123 RuntimeContextName =
"";
124 CyclicExecutionCount = 0;
125 CyclicExecuteAsyncIsProcessing =
false;
126 ExpectedConnectionState = ExpectedState::None;
130 CustomScreenImplementation =
nullptr;
131 ContextVariableImplementation =
nullptr;
133 StateVariableImplementation =
nullptr;
134 MeasureImplementation =
nullptr;
135 ServiceProviderImplementation =
nullptr;
137 _BasicScreenOutputImpl =
nullptr;
138 _CommonDialogsOutputImpl =
nullptr;
139 _ContextVariableOutputImpl =
nullptr;
140 _CustomScreenOutputImpl =
nullptr;
141 _ServiceProviderOutputImpl =
nullptr;
142 _I18nOutputImpl =
nullptr;
143 _LoggingOutputImpl =
nullptr;
144 _MeasureOutputImpl =
nullptr;
145 _SqlOutputImpl =
nullptr;
146 _StateVariableOutputImpl =
nullptr;
148 WebServerTimer =
gcnew System::Windows::Forms::Timer();
149 ErrorProvider =
gcnew System::Windows::Forms::ErrorProvider();
152 static bool IsRegistered;
153 static std::string FileVersion;
154 static std::vector<msclr::auto_gcroot<SampleForm^>> ListForms;
156 msclr::auto_gcroot<SampleForm^> CreatorForm;
157 msclr::auto_gcroot<HmiWindow^> HmiWindow;
158 msclr::auto_gcroot<System::Windows::Forms::Timer^> WebServerTimer;
159 msclr::auto_gcroot<System::DateTime^> LastTime;
160 std::shared_ptr<IRuntimeManager> GlobalRuntimeManager;
161 std::vector<OpenTestSystem::Otx::Runtime::Api::IRuntimeContext*> RuntimeContexts;
162 msclr::auto_gcroot<System::Object^> LockRuntimeContexts;
163 msclr::auto_gcroot<System::Object^> EventListenerLock;
164 msclr::auto_gcroot<System::Object^> PrintTextLock;
165 std::map<long long, long long> RuntimeContextIdsExecutionStartTick;
166 msclr::auto_gcroot<System::Windows::Forms::ErrorProvider^> ErrorProvider;
168 std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IProject> Project;
169 std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Project::IPlayerProject> PlayerProject;
170 std::shared_ptr<OpenTestSystem::Otx::Runtime::Api::Otx::IProcedure> ProcedureToExecute;
172 msclr::auto_gcroot<System::Windows::Forms::TreeNode^> StartUpNode;
174 long ProcedureExecutionCount;
180 bool UseConnectionState;
185 int DefaultRuntimePort;
186 std::string DefaultDiagPipeName;
187 std::string DefaultRuntimePipeName;
190 std::string RuntimeContextName;
191 int CyclicExecutionCount;
192 bool CyclicExecuteAsyncIsProcessing;
195 #pragma region C++ for RAW-mode
196 std::string IpcInitializedBefore;
202 std::shared_ptr<Custom::DefaultCustomScreenImplementation> CustomScreenImplementation;
203 std::shared_ptr<Custom::ContextVariableImplementation> ContextVariableImplementation;
205 std::shared_ptr<Custom::StateVariableImplementation> StateVariableImplementation;
206 std::shared_ptr<Custom::DefaultMeasureImplementation> MeasureImplementation;
207 std::shared_ptr<Custom::DefaultExternalServiceProviderImplementation> ServiceProviderImplementation;
209 std::shared_ptr<BasicScreenOutputImpl> _BasicScreenOutputImpl;
210 std::shared_ptr<CommonDialogsOutputImpl> _CommonDialogsOutputImpl;
211 std::shared_ptr<ContextVariableOutputImpl> _ContextVariableOutputImpl;
212 std::shared_ptr<CustomScreenOutputImpl> _CustomScreenOutputImpl;
213 std::shared_ptr<ExternalServiceProviderOutputImpl> _ServiceProviderOutputImpl;
214 std::shared_ptr<I18nOutputImpl> _I18nOutputImpl;
215 std::shared_ptr<LoggingOutputImpl> _LoggingOutputImpl;
216 std::shared_ptr<MeasureOutputImpl> _MeasureOutputImpl;
217 std::shared_ptr<SqlOutputImpl> _SqlOutputImpl;
218 std::shared_ptr<StateVariableOutputImpl> _StateVariableOutputImpl;
220 const int VALUE_STRING_MAX_LENGTH = 1024;
221 const int FORM_OFFSET = 25;
222 const int DEFAULT_POLLING_TIME = 500;
223 const int DEFAULT_BATTERY_VOLTAGE_THRESHOLD = 6000;
225 void InitializeRuntimeEvents(std::shared_ptr<IRuntimeManager> runtimeManager)
227 REFAPP_START_METHOD();
228 if (runtimeManager ==
nullptr)
234 RemoveRuntimeEvents(runtimeManager);
236 _ProcedurePending = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedurePending,
this, std::placeholders::_1));
237 _ProcedureStarted = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureStarted,
this, std::placeholders::_1));
238 _ProcedurePaused = std::make_shared<std::function<void(
const IRuntimeContext&, ExecutionStateChangeReason)>>(std::bind(&SampleFormImpl::ProcedurePaused,
this, std::placeholders::_1, std::placeholders::_2));
239 _ProcedureContinued = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureContinued,
this, std::placeholders::_1));
240 _ProcedureFinished = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureFinished,
this, std::placeholders::_1));
241 _ProcedureStopped = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureStopped,
this, std::placeholders::_1));
242 _ProcedureAborted = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureAborted,
this, std::placeholders::_1));
243 _ProcedureTimeout = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureTimeout,
this, std::placeholders::_1));
244 _DiagConnectionStateChanged = std::make_shared<std::function<void(ClampState, ClampState)>>(std::bind(&SampleFormImpl::DiagConnectionStateChanged,
this, std::placeholders::_1, std::placeholders::_2));
245 _InOutParameterValueChanged = std::make_shared<std::function<void(
const IRuntimeContext&,
const IProcedureInOutParameter&)>>(std::bind(&SampleFormImpl::InOutParameterValueChanged,
this, std::placeholders::_1, std::placeholders::_2));
247 runtimeManager->AddProcedurePendingListener(_ProcedurePending);
248 runtimeManager->AddProcedureStartedListener(_ProcedureStarted);
249 runtimeManager->AddProcedurePausedListener(_ProcedurePaused);
250 runtimeManager->AddProcedureContinuedListener(_ProcedureContinued);
251 runtimeManager->AddProcedureFinishedListener(_ProcedureFinished);
252 runtimeManager->AddProcedureStoppedListener(_ProcedureStopped);
253 runtimeManager->AddProcedureAbortedListener(_ProcedureAborted);
254 runtimeManager->AddProcedureTimeoutListener(_ProcedureTimeout);
255 runtimeManager->AddDiagConnectionStateChangedListener(_DiagConnectionStateChanged);
256 runtimeManager->AddInOutParameterValueChangedListener(_InOutParameterValueChanged);
260 void RemoveRuntimeEvents(std::shared_ptr<IRuntimeManager> runtimeManager)
262 REFAPP_START_METHOD();
263 if (_ProcedurePending !=
nullptr)
265 runtimeManager->RemoveProcedurePendingListener(_ProcedurePending);
268 if (_ProcedureStarted !=
nullptr)
270 runtimeManager->RemoveProcedureStartedListener(_ProcedureStarted);
273 if (_ProcedurePaused !=
nullptr)
275 runtimeManager->RemoveProcedurePausedListener(_ProcedurePaused);
278 if (_ProcedureContinued !=
nullptr)
280 runtimeManager->RemoveProcedureContinuedListener(_ProcedureContinued);
283 if (_ProcedureFinished !=
nullptr)
285 runtimeManager->RemoveProcedureFinishedListener(_ProcedureFinished);
288 if (_ProcedureStopped !=
nullptr)
290 runtimeManager->RemoveProcedureStoppedListener(_ProcedureStopped);
293 if (_ProcedureAborted !=
nullptr)
295 runtimeManager->RemoveProcedureAbortedListener(_ProcedureAborted);
298 if (_ProcedureTimeout !=
nullptr)
300 runtimeManager->RemoveProcedureTimeoutListener(_ProcedureTimeout);
303 if (_DiagConnectionStateChanged !=
nullptr)
305 runtimeManager->RemoveDiagConnectionStateChangedListener(_DiagConnectionStateChanged);
308 if (_InOutParameterValueChanged !=
nullptr)
310 runtimeManager->RemoveInOutParameterValueChangedListener(_InOutParameterValueChanged);
315 void ProcedurePending(
const IRuntimeContext& context)
317 Owner->ProcedurePendingCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
320 void ProcedureStarted(
const IRuntimeContext& context)
322 Owner->ProcedureStartedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
325 void ProcedurePaused(
const IRuntimeContext& context, ExecutionStateChangeReason reason)
327 IRuntimeContext* pContext =
const_cast<IRuntimeContext*
>(&context);
328 Owner->ProcedurePaused(pContext, reason);
331 void ProcedureContinued(
const IRuntimeContext& context)
333 Owner->ProcedureContinuedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
336 void ProcedureFinished(
const IRuntimeContext& context)
338 Owner->ProcedureFinishedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
341 void ProcedureStopped(
const IRuntimeContext& context)
343 Owner->ProcedureStoppedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
346 void ProcedureAborted(
const IRuntimeContext& context)
348 Owner->ProcedureAbortedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
351 void ProcedureTimeout(
const IRuntimeContext& context)
353 Owner->ProcedureTimeoutCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
356 void DiagConnectionStateChanged(ClampState batteryState, ClampState ignitionState)
358 Owner->DiagConnectionStateChanged(batteryState, ignitionState);
361 void InOutParameterValueChanged(
const IRuntimeContext& context,
const IProcedureInOutParameter& parameter)
363 REFAPP_START_METHOD();
364 IRuntimeContext* pContext =
const_cast<IRuntimeContext*
>(&context);
365 IProcedureInOutParameter* pParameter =
const_cast<IProcedureInOutParameter*
>(¶meter);
366 Owner->InOutParameterValueChanged(pContext, pParameter);
370 void SetDefaultCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
372 REFAPP_START_METHOD();
373 if (runtimeManager ==
nullptr)
379 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IBasicScreenImplementation>)
nullptr);
380 runtimeManager->SetCustomImplementation(CustomScreenImplementation);
381 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ILoggingImplementation>)
nullptr);
382 runtimeManager->SetCustomImplementation(ContextVariableImplementation);
384 runtimeManager->SetCustomImplementation(StateVariableImplementation);
385 runtimeManager->SetCustomImplementation(MeasureImplementation);
386 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::Ii18nImplementation>)
nullptr);
387 runtimeManager->SetCustomImplementation(ServiceProviderImplementation);
389 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ISqlImplementation>)
nullptr);
390 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ICommonDialogsImplementation>)
nullptr);
394 void RemoveCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
396 REFAPP_START_METHOD();
397 if (runtimeManager ==
nullptr)
403 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IBasicScreenImplementation>)
nullptr);
404 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ICustomScreenImplementation>)
nullptr);
405 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ICommonDialogsImplementation>)
nullptr);
406 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IContextVariableImplementation>)
nullptr);
407 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IExternalServiceProviderImplementation>)
nullptr);
408 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::Ii18nImplementation>)
nullptr);
409 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ILoggingImplementation>)
nullptr);
410 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IMeasureImplementation>)
nullptr);
411 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ISqlImplementation>)
nullptr);
412 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IStateVariableImplementation>)
nullptr);
416 void ClearCustomImplemetationCaches()
418 REFAPP_START_METHOD();
419 if (IS_NOT_NULL(ContextVariableImplementation))
421 ContextVariableImplementation->ResetAllValues();
424 if (IS_NOT_NULL(_ContextVariableOutputImpl))
426 _ContextVariableOutputImpl->ResetAllValues();
429 if (IS_NOT_NULL(StateVariableImplementation))
431 StateVariableImplementation->ResetAllValues();
438 void CreateDefaultCustomImpl()
440 REFAPP_START_METHOD();
441 CustomScreenImplementation = std::make_shared<Custom::DefaultCustomScreenImplementation>();
442 _KeyDown = std::make_shared<std::function<void(std::shared_ptr<Custom::KeyEventArgs>)>>(std::bind(&SampleFormImpl::CustomScreenImplementation_KeyDown,
this, std::placeholders::_1));
443 CustomScreenImplementation->AddKeyDownListener(_KeyDown);
445 ContextVariableImplementation = std::make_shared<Custom::ContextVariableImplementation>();
446 _ContextVariableRead = std::make_shared<std::function<void(std::shared_ptr<IContextVariable>, std::shared_ptr<DataTypes::Object>)>>(std::bind(&SampleFormImpl::ContextVariableRead,
this, std::placeholders::_1, std::placeholders::_2));
447 ContextVariableImplementation->SetContextVariableReadHandler(_ContextVariableRead);
449 StateVariableImplementation = std::make_shared<Custom::StateVariableImplementation>();
450 _StateVariableValueChanged = std::make_shared<std::function<void(std::shared_ptr<IStateVariable>, std::shared_ptr<DataTypes::Object>)>>(std::bind(&SampleFormImpl::StateVariableValueChanged,
this, std::placeholders::_1, std::placeholders::_2));
451 StateVariableImplementation->SetStateVariableValueChangedHandler(_StateVariableValueChanged);
453 MeasureImplementation = std::make_shared<Custom::DefaultMeasureImplementation>();
454 ServiceProviderImplementation = std::make_shared<Custom::DefaultExternalServiceProviderImplementation>();
458 void CustomScreenImplementation_KeyDown(std::shared_ptr<Custom::KeyEventArgs> eventArgs)
460 Owner->CustomScreenImplementation_KeyDown(eventArgs);
463 void ContextVariableRead(std::shared_ptr<IContextVariable> contextVariable, std::shared_ptr<DataTypes::Object> value)
465 Owner->ContextVariableRead(contextVariable, value);
468 void StateVariableValueChanged(std::shared_ptr<IStateVariable> stateVariable, std::shared_ptr<DataTypes::Object> value)
470 Owner->StateVariableValueChanged(stateVariable, value);
473 void CreateOutputWindowCustomImpl()
475 REFAPP_START_METHOD();
476 _BasicScreenOutputImpl = std::make_shared<BasicScreenOutputImpl>();
477 _CustomScreenOutputImpl = std::make_shared<CustomScreenOutputImpl>();
478 _LoggingOutputImpl = std::make_shared<LoggingOutputImpl>();
479 _ContextVariableOutputImpl = std::make_shared<ContextVariableOutputImpl>();
481 _StateVariableOutputImpl = std::make_shared<StateVariableOutputImpl>();
482 _MeasureOutputImpl = std::make_shared<MeasureOutputImpl>();
483 _I18nOutputImpl = std::make_shared<I18nOutputImpl>();
484 _ServiceProviderOutputImpl = std::make_shared<ExternalServiceProviderOutputImpl>();
486 _CommonDialogsOutputImpl = std::make_shared<CommonDialogsOutputImpl>();
487 _SqlOutputImpl = std::make_shared<SqlOutputImpl>();
489 _BasicScreenOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
490 _CustomScreenOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
491 _LoggingOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
492 _ContextVariableOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
494 _StateVariableOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
495 _MeasureOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
496 _I18nOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
497 _ServiceProviderOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
499 _CommonDialogsOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
500 _SqlOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
504 void RemoveOutputImplLogEventHandler()
506 REFAPP_START_METHOD();
507 if (_BasicScreenOutputImpl !=
nullptr)
508 _BasicScreenOutputImpl->_logEventHandler =
nullptr;
509 if (_CustomScreenOutputImpl !=
nullptr)
510 _CustomScreenOutputImpl->_logEventHandler =
nullptr;
511 if (_LoggingOutputImpl !=
nullptr)
512 _LoggingOutputImpl->_logEventHandler =
nullptr;
513 if (_ContextVariableOutputImpl !=
nullptr)
514 _ContextVariableOutputImpl->_logEventHandler =
nullptr;
516 if (_StateVariableOutputImpl !=
nullptr)
517 _StateVariableOutputImpl->_logEventHandler =
nullptr;
518 if (_MeasureOutputImpl !=
nullptr)
519 _MeasureOutputImpl->_logEventHandler =
nullptr;
520 if (_I18nOutputImpl !=
nullptr)
521 _I18nOutputImpl->_logEventHandler =
nullptr;
522 if (_ServiceProviderOutputImpl !=
nullptr)
523 _ServiceProviderOutputImpl->_logEventHandler =
nullptr;
525 if (_CommonDialogsOutputImpl !=
nullptr)
526 _CommonDialogsOutputImpl->_logEventHandler =
nullptr;
527 if (_SqlOutputImpl !=
nullptr)
528 _SqlOutputImpl->_logEventHandler =
nullptr;
530 _BasicScreenOutputImpl =
nullptr;
531 _CustomScreenOutputImpl =
nullptr;
532 _LoggingOutputImpl =
nullptr;
533 _ContextVariableOutputImpl =
nullptr;
535 _StateVariableOutputImpl =
nullptr;
536 _MeasureOutputImpl =
nullptr;
537 _I18nOutputImpl =
nullptr;
538 _ServiceProviderOutputImpl =
nullptr;
540 _CommonDialogsOutputImpl =
nullptr;
541 _SqlOutputImpl =
nullptr;
545 void WriteLogEvent(
const std::string& text)
547 Owner->PrintTextCallback(Util::Util::ToString(text));
550 void SetOutputWindowImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
552 REFAPP_START_METHOD();
553 if (runtimeManager ==
nullptr)
558 runtimeManager->SetCustomImplementation(_BasicScreenOutputImpl);
559 runtimeManager->SetCustomImplementation(_CommonDialogsOutputImpl);
560 runtimeManager->SetCustomImplementation(_ContextVariableOutputImpl);
561 runtimeManager->SetCustomImplementation(_CustomScreenOutputImpl);
562 runtimeManager->SetCustomImplementation(_ServiceProviderOutputImpl);
563 runtimeManager->SetCustomImplementation(_I18nOutputImpl);
564 runtimeManager->SetCustomImplementation(_LoggingOutputImpl);
565 runtimeManager->SetCustomImplementation(_MeasureOutputImpl);
566 runtimeManager->SetCustomImplementation(_SqlOutputImpl);
567 runtimeManager->SetCustomImplementation(_StateVariableOutputImpl);
572 msclr::auto_gcroot<SampleForm^> Owner;
573 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedurePending;
574 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureStarted;
575 std::shared_ptr<std::function<void(
const IRuntimeContext&, ExecutionStateChangeReason)>> _ProcedurePaused;
576 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureContinued;
577 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureFinished;
578 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureStopped;
579 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureAborted;
580 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureTimeout;
581 std::shared_ptr<std::function<void(ClampState, ClampState)>> _DiagConnectionStateChanged;
582 std::shared_ptr<std::function<void(
const IRuntimeContext&,
const IProcedureInOutParameter&)>> _InOutParameterValueChanged;
584 std::shared_ptr<std::function<void(std::shared_ptr<Custom::KeyEventArgs>)>> _KeyDown;
585 std::shared_ptr<std::function<void(std::shared_ptr<IContextVariable>, std::shared_ptr<DataTypes::Object>)>> _ContextVariableRead;
586 std::shared_ptr<std::function<void(std::shared_ptr<IStateVariable>, std::shared_ptr<DataTypes::Object>)>> _StateVariableValueChanged;
589 bool SampleFormImpl::IsRegistered =
false;
590 std::string SampleFormImpl::FileVersion =
"";
591 std::vector<msclr::auto_gcroot<SampleForm^>> SampleFormImpl::ListForms;
593 void SampleForm::RegisterSettingsEvent()
595 REFAPP_START_METHOD();
596 if (!SampleFormImpl::IsRegistered)
598 SampleFormImpl::IsRegistered =
true;
600 SampleFormImpl::FileVersion = RuntimeConfig::GetInstance().GetVersion();
603 System::String^ licenseKeyFromOTForOTPLicense;
606 if (!System::String::IsNullOrEmpty(licenseKeyFromOTForOTPLicense) && Util::LicenseUtil::CheckLicenseFormat(Util::Util::ToString(licenseKeyFromOTForOTPLicense)))
612 std::string licenseKey = Setting::UserSettings::GetInstance().GetLicenseKey();
613 licenseKey = Util::LicenseUtil::Decrypt(licenseKey);
614 if (Util::LicenseUtil::CheckLicenseFormat(licenseKey))
620 System::Windows::Forms::MessageBox::Show(
"There is an invalid license key format. Please set your new key in license box.",
"Warning!", System::Windows::Forms::MessageBoxButtons::OK, System::Windows::Forms::MessageBoxIcon::Warning);
624 Microsoft::Win32::SystemEvents::DisplaySettingsChanged +=
gcnew System::EventHandler(
this, &OpenTestSystem::Otx::Runtime2::Api::Sample::SampleForm::SystemEvents_DisplaySettingsChanged);
629 void SampleForm::SystemEvents_DisplaySettingsChanged(System::Object^ sender, System::EventArgs^ e)
631 REFAPP_START_METHOD();
634 for (
int i = 0; i < SampleFormImpl::ListForms.size(); i++)
636 msclr::auto_gcroot<SampleForm^> frm = SampleFormImpl::ListForms.at(i);
639 if (frm.get()->InvokeRequired)
641 frm.get()->Invoke(
gcnew System::Action(frm.get(), &SampleForm::Refresh));
645 frm.get()->Refresh();
655 void SampleForm::InitializeInternalComponent()
657 REFAPP_START_METHOD();
658 piml =
new SampleFormImpl(
this);
659 RegisterSettingsEvent();
663 SampleForm::SampleForm(System::String^ title, SampleForm^ creatorForm)
665 REFAPP_START_METHOD();
666 ShowInTaskbar =
false;
667 InitializeInternalComponent();
669 piml->Title = System::String::IsNullOrEmpty(title) ? SampleConstants::MAIN_INSTANCE_NAME : Util::Util::ToString(title);
670 piml->CreatorForm = creatorForm;
672 piml->WebServerTimer->Interval = 1000;
673 piml->WebServerTimer->Enabled =
true;
674 piml->WebServerTimer->Tick +=
gcnew System::EventHandler(
this, &SampleForm::WebServerTimer_Tick);
676 InitializeComponent();
678 piml->ListForms.push_back(
this);
680 PrintTextCallback(
"Application started");
684 System::Void SampleForm::SampleForm_Load(System::Object^ sender, System::EventArgs^ e)
686 REFAPP_START_METHOD();
688 PrintTextCallback(
"Start Initialization...");
691 InitializeSampleDefaultValues();
692 UpdateWebServerButtonCallback();
694 if (IS_NOT_NULL(piml->CreatorForm))
696 checkBoxStartAllParents->Visible =
true;
697 checkBoxStartAllParents->Checked = piml->CreatorForm->checkBoxStartAllParents->Checked;
700 SetRuntimeContextName();
701 SetTitle(Util::Util::ToString(piml->Title));
702 SetLocation(piml->CreatorForm.get());
704 toolTip1->SetToolTip(labelProcedureExecutionTimes,
"Total procedure execution time.");
705 toolTip1->SetToolTip(textBoxTimeout,
"Timeout for procedure execution in milliseconds. The default value 0 means without timeout.");
706 toolTip1->SetToolTip(checkBoxUseConnectionState,
"Use expected connection state during procedure execution.");
707 toolTip1->SetToolTip(labelBatteryState,
"State of the battery (KL 30)");
708 toolTip1->SetToolTip(checkBoxIgnition,
"Expected ignition (KL 15) state during procedure execution");
709 toolTip1->SetToolTip(labelIgnitionState,
"State of the ignition (KL 15)");
710 toolTip1->SetToolTip(buttonCheckBatteryIgnition,
"Check current battery (KL30) and ignition (KL15) state.");
711 toolTip1->SetToolTip(textBoxPollingTime,
"Time in milliseconds between the next check of the connection state during the procedure execution (Polling). The default value is 500 ms.");
712 toolTip1->SetToolTip(textBoxVoltageThreshold,
"Voltage threshold in millivolt from which the battery voltage, see GetBatteryVoltage is enough for KL30 = On. The default value is 6000 mV.");
714 LoadContextFile(piml->GlobalRuntimeManager);
716 PrintTextCallback(
"... Initialization finished.");
717 ShowInTaskbar =
true;
718 #pragma region Only Cpp: See issue 15942 - bug 7
719 WindowState = System::Windows::Forms::FormWindowState::Normal;
724 System::Void SampleForm::SampleForm_Shown(System::Object^ sender, System::EventArgs^ e)
726 cbFilePath->SelectionLength = 0;
730 void SampleForm::SetRuntimeContextName()
732 REFAPP_START_METHOD();
733 if (IS_NOT_NULL(piml->CreatorForm) && !System::String::IsNullOrEmpty(Util::Util::ToString(piml->CreatorForm->piml->RuntimeContextName)))
735 System::String^ contextName = Util::Util::ToString(piml->CreatorForm->piml->RuntimeContextName);
736 System::Text::RegularExpressions::Match^ regExpMatch = System::Text::RegularExpressions::Regex::Match(contextName,
"\d*$");
738 if (System::Int32::TryParse(regExpMatch->Value, number))
742 if (Util::Util::IsInstance<System::Windows::Forms::TextBox^>(textBoxRuntimeContextName))
744 textBoxRuntimeContextName->Text = Util::Util::ToString(piml->CreatorForm->piml->RuntimeContextName.substr(0, regExpMatch->Index) + std::to_string(number));
751 void SampleForm::SetTitle(System::String^ title)
753 REFAPP_START_METHOD();
754 if (System::String::IsNullOrWhiteSpace(title))
756 title = Util::Util::ToString(SampleConstants::MAIN_INSTANCE_NAME);
759 bool runningAsAdmin = System::Security::Principal::WindowsIdentity::GetCurrent()->Owner->IsWellKnown(System::Security::Principal::WellKnownSidType::BuiltinAdministratorsSid);
761 Text = System::String::Format(
762 "emotive OTX-Runtime API for Cpp - Reference Application - Version {0} - {1} Bit - {2} - Thread-ID {3}{4}",
763 Util::Util::ToString(piml->FileVersion),
764 System::Environment::Is64BitProcess ?
"64" :
"32",
765 Util::Util::ToString(piml->Title),
766 System::Threading::Thread::CurrentThread->ManagedThreadId,
767 runningAsAdmin ?
" - Administrator" : System::String::Empty
770 if (Util::Util::IsInstance<System::Windows::Forms::ComboBox^>(cbFilePath) && !System::String::IsNullOrEmpty(cbFilePath->Text))
772 Text = Text +
" - " + System::IO::Path::GetFileName(cbFilePath->Text);
775 System::String^ runtimeContextNameCliStr = Util::Util::ToString(piml->RuntimeContextName);
776 if (!System::String::IsNullOrEmpty(runtimeContextNameCliStr))
778 Text = Text +
" - " + runtimeContextNameCliStr;
783 void SampleForm::SetLocation(SampleForm^ creatorForm)
785 REFAPP_START_METHOD();
786 if (creatorForm !=
nullptr)
788 int xOffset = piml->FORM_OFFSET;
789 int yOffset = piml->FORM_OFFSET;
791 if (IS_NOT_NULL(creatorForm->piml->CreatorForm))
793 xOffset = creatorForm->Location.X - creatorForm->piml->CreatorForm->Location.X;
794 yOffset = creatorForm->Location.Y - creatorForm->piml->CreatorForm->Location.Y;
797 Location = Point(creatorForm->Location.X + xOffset, creatorForm->Location.Y + yOffset);
798 Size = creatorForm->Size;
803 void SampleForm::CreateCustomImpl()
805 REFAPP_START_METHOD();
806 CreateDefaultCustomImpl();
807 CreateOutputWindowCustomImpl();
811 void SampleForm::CreateDefaultCustomImpl()
813 REFAPP_START_METHOD();
814 PrintTextCallback(
"Create default custom implementation");
816 piml->CreateDefaultCustomImpl();
820 void SampleForm::CreateOutputWindowCustomImpl()
822 REFAPP_START_METHOD();
823 PrintTextCallback(
"Create output window custom implementation");
825 piml->CreateOutputWindowCustomImpl();
829 void SampleForm::InitializeSampleDefaultValues()
831 REFAPP_START_METHOD();
832 PrintTextCallback(
"Initialize default values");
834 comboBoxTraceLevel->Items->AddRange(Util::Util::ArrayTraceLevels2String());
837 treeViewOtxProject->ImageList = imageList1;
839 textBoxRtPortPipe->Name = Util::Util::ToString(SampleConstants::RT_PORT_PIPE_TEXT_BOX_NAME);
840 textBoxDiagPortPipe->Name = Util::Util::ToString(SampleConstants::DM_PORT_PIPE_TEXT_BOX_NAME);
844 EnableConnectionState();
848 void SampleForm::LoadSetting()
850 REFAPP_START_METHOD();
851 Setting::UserSettings::GetInstance().Reload();
856 SetupTraceFileProfilerMaxCountAndSize();
859 SetupDefaultPortAndPipeName();
861 cbFilePath->Text = Util::Util::ToString(Setting::UserSettings::GetInstance().GetPtxPpxDirectory());
862 if (!Setting::UserSettings::GetInstance().GetPtxPpxDirectoryList().empty())
864 cbFilePath->Items->AddRange(Util::Util::ToString(Setting::UserSettings::GetInstance().GetPtxPpxDirectoryList())->Split(
';'));
866 AddComboBoxFileOrPath(cbFilePath);
868 SetupCustomImplType();
870 SetupWindowLocation();
872 checkBoxAsyncExecution->Checked = Setting::UserSettings::GetInstance().GetAsynchron();
873 checkBoxCyclicExecution->Checked = Setting::UserSettings::GetInstance().GetCyclic();
874 checkBoxCyclicReload->Checked = Setting::UserSettings::GetInstance().GetCyclicReload();
875 checkBoxNewRuntimeManager->Checked = Setting::UserSettings::GetInstance().GetNewRuntimeManager();
876 checkBoxAdd2Output->Checked = Setting::UserSettings::GetInstance().GetAddMessageToOutput();
877 checkBoxStartAllParents->Checked = Setting::UserSettings::GetInstance().GetStartAllParents();
880 checkBoxUseConnectionState->Checked = Setting::UserSettings::GetInstance().GetConnectionState();
881 checkBoxIgnition->CheckState = Setting::UserSettings::GetInstance().GetIgnition() == 1 ? System::Windows::Forms::CheckState::Checked
882 : (Setting::UserSettings::GetInstance().GetIgnition() == 0 ? System::Windows::Forms::CheckState::Unchecked
883 : System::Windows::Forms::CheckState::Indeterminate);
885 SetupVoltageThreshold();
887 textBoxRuntimeContextName->Text = Util::Util::ToString(Setting::UserSettings::GetInstance().GetRuntimeContextName());
889 #pragma region C++ for RAW-Mode
890 textBoxDiagManagerLicenseKey->Text = Util::Util::ToString(Util::LicenseUtil::Decrypt(Setting::UserSettings::GetInstance().GetDiagManagerLicenseKey()));
891 checkBoxIncludedDiagLogging->Checked = Setting::UserSettings::GetInstance().GetIncludeTraceDiagLogging();
893 std::string traceFolder = Setting::UserSettings::GetInstance().GetDiagTraceDirectory();
894 textBoxDiagManagerTraceFolder->Text = Util::Util::ToString(traceFolder.empty() ? Util::OtxDiagUtil::GetPathLoggerDefault() : traceFolder);
898 catch (
const std::exception& e)
900 PrintTextCallback(Util::Util::ToString(e.what()));
901 Setting::UserSettings::GetInstance().Reset();
903 catch (System::Exception^ e)
905 PrintTextCallback(e->Message);
906 Setting::UserSettings::GetInstance().Reset();
911 void SampleForm::AddComboBoxFileOrPath(System::Windows::Forms::ComboBox^ comboBox)
913 REFAPP_START_METHOD();
914 if (comboBox !=
nullptr && !piml->IsPathChanging)
916 piml->IsPathChanging =
true;
918 System::String^ path = comboBox->Text;
920 if (System::IO::Directory::Exists(path) || System::IO::File::Exists(path))
922 while (comboBox->Items->Contains(path))
924 comboBox->Items->Remove(path);
927 while (comboBox->Items->Contains(path->TrimEnd(
gcnew cli::array<wchar_t>(2) {
'/',
'\\' })))
929 comboBox->Items->Remove(path->TrimEnd(
gcnew cli::array<wchar_t>(2) {
'/',
'\\' }));
932 path = path->TrimEnd(
gcnew cli::array<wchar_t>(2) {
'/',
'\\' });
934 comboBox->Items->Insert(0, path);
935 comboBox->Text = path;
936 comboBox->SelectAll();
939 piml->IsPathChanging =
false;
944 void SampleForm::SetupTraceFileProfilerMaxCountAndSize()
946 REFAPP_START_METHOD();
947 RuntimeConfig::GetInstance().SetTraceFileMaxCount(Setting::UserSettings::GetInstance().GetTraceFileMaxCount());
948 textBoxTraceFileMaxCount->Text = Setting::UserSettings::GetInstance().GetTraceFileMaxCount().ToString();
950 RuntimeConfig::GetInstance().SetTraceFileMaxSize(Setting::UserSettings::GetInstance().GetTraceFileMaxSize());
951 textBoxTraceFileMaxSize->Text = Setting::UserSettings::GetInstance().GetTraceFileMaxSize().ToString();
953 RuntimeConfig::GetInstance().SetProfiling(Setting::UserSettings::GetInstance().GetProfiling());
954 checkBoxProfiling->Checked = Setting::UserSettings::GetInstance().GetProfiling();
956 RuntimeConfig::GetInstance().SetProfilingMaxFileSize(Setting::UserSettings::GetInstance().GetProfilingMaxFileSize());
957 textBoxProfilingSize->Text = Setting::UserSettings::GetInstance().GetProfilingMaxFileSize().ToString();
961 void SampleForm::SetupDefaultPortAndPipeName()
963 REFAPP_START_METHOD();
964 piml->DefaultDiagPort = Setting::UserSettings::GetInstance().GetDiagManagerPort();
965 piml->DefaultRuntimePort = Setting::UserSettings::GetInstance().GetRuntimePort();
967 piml->DefaultDiagPipeName = Setting::UserSettings::GetInstance().GetDiagManagerPipeName();
968 piml->DefaultRuntimePipeName = Setting::UserSettings::GetInstance().GetRuntimePipeName();
970 IpcTypes ipcType = IpcTypes::Socket;
971 ipcType = Setting::UserSettings::GetInstance().GetIpcType();
973 if (comboBoxIpcType->Items->Count == 0)
976 comboBoxIpcType->Items->AddRange(Util::Util::ArrayIpcTypes2String());
979 comboBoxIpcType->SelectedItem = Util::Util::ToString(ipcType);
983 void SampleForm::SetupTraceLevel()
985 REFAPP_START_METHOD();
986 TraceLevels traceLevels = Setting::UserSettings::GetInstance().GetTraceLevels();
990 comboBoxTraceLevel->SelectedItem = Util::Util::ToString(traceLevels);
994 void SampleForm::SetupTraceFolder()
996 REFAPP_START_METHOD();
997 if (Setting::UserSettings::GetInstance().GetTracingDirectory().empty() !=
true)
1002 textBoxTraceFolder->Text = Util::Util::ToString(RuntimeConfig::GetInstance().GetTraceFolder());
1003 REFAPP_END_METHOD();
1006 void SampleForm::SetupCustomImplType()
1008 REFAPP_START_METHOD();
1009 if (Setting::UserSettings::GetInstance().GetCustomImplTypes() == CustomImplTypes::OutputImpl)
1011 radioButtonOuputWindow->Checked =
true;
1013 else if (Setting::UserSettings::GetInstance().GetCustomImplTypes() == CustomImplTypes::NoCustom)
1015 radioButtonNoCustomImplementation->Checked =
true;
1019 radioButtonDefaultImplementation->Checked =
true;
1021 REFAPP_END_METHOD();
1024 void SampleForm::SetupWindowSize()
1026 REFAPP_START_METHOD();
1027 int width = Setting::UserSettings::GetInstance().GetWindowWidth();
1028 int height = Setting::UserSettings::GetInstance().GetWindowHeight();
1029 Size = System::Drawing::Size(width, height);
1030 REFAPP_END_METHOD();
1033 void SampleForm::SetupWindowLocation()
1035 REFAPP_START_METHOD();
1036 int locationX = Setting::UserSettings::GetInstance().GetWindowLocationX();
1037 int locationY = Setting::UserSettings::GetInstance().GetWindowLocationY();
1038 System::Drawing::Point location = System::Drawing::Point(locationX, locationY);
1040 if (CheckFormIsInBound(location))
1042 Location = location;
1043 REFAPP_END_METHOD();
1048 REFAPP_END_METHOD();
1051 bool SampleForm::CheckFormIsInBound(System::Drawing::Point location)
1053 REFAPP_START_METHOD();
1056 #pragma region C++ can not use Linq
1057 cli::array<System::Windows::Forms::Screen^>^ formContainScreens = System::Windows::Forms::Screen::AllScreens;
1058 for (
int i = 0; i < formContainScreens->Length; i++)
1060 if (formContainScreens[i]->Bounds.Contains(location))
1062 REFAPP_END_METHOD();
1067 REFAPP_END_METHOD();
1073 REFAPP_END_METHOD();
1078 void SampleForm::SetupTimeOut()
1080 REFAPP_START_METHOD();
1081 System::String^ timeOutString = Setting::UserSettings::GetInstance().GetTimeOut().ToString();
1082 textBoxTimeout->Text = timeOutString;
1083 REFAPP_END_METHOD();
1086 void SampleForm::SetupPollingTime()
1088 REFAPP_START_METHOD();
1089 std::string pollingTimeString = std::to_string(Setting::UserSettings::GetInstance().GetPollingTime());
1090 textBoxPollingTime->Text = Util::Util::ToString(pollingTimeString);
1091 REFAPP_END_METHOD();
1094 void SampleForm::SetupVoltageThreshold()
1096 REFAPP_START_METHOD();
1097 std::string voltageThreshold = std::to_string(Setting::UserSettings::GetInstance().GetVoltageThreshold());
1098 textBoxVoltageThreshold->Text = Util::Util::ToString(voltageThreshold);
1099 REFAPP_END_METHOD();
1102 System::Void SampleForm::comboBoxIpcType_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
1104 REFAPP_START_METHOD();
1106 textBoxDiagPortPipe->TextChanged -=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
1107 IpcTypes ipcType = Util::Util::ToIpcType(comboBoxIpcType->SelectedItem->ToString());
1109 #pragma region C++ for design has RAW-mode
1111 textBoxDiagPortPipe->Hide();
1112 textBoxRtPortPipe->Hide();
1113 comboBoxODXProject->Hide();
1115 comboBoxODXVehicle->Hide();
1116 portPipeLabel->Hide();
1117 labelOdxProject->Hide();
1120 panel1->Size = System::Drawing::Size(panel1->Size.Width, 61);
1121 portPipeLabel->Location = System::Drawing::Point(portPipeLabel->Location.X, 34);
1122 textBoxDiagPortPipe->Location = System::Drawing::Point(Width - 95, 31);
1123 textBoxDiagPortPipe->Size = System::Drawing::Size(55, 22);
1128 #pragma region C++ for RAW-mode
1131 panel1->Size = System::Drawing::Size(panel1->Size.Width, 116);
1133 SetupDiagManagerControls();
1135 comboBoxDiagIpcType_SelectedValueChanged(comboBoxDiagIpcType,
nullptr);
1140 case IpcTypes::Socket:
1142 portPipeLabel->Show();
1143 portPipeLabel->Text =
"Runner / DiagManager Ports";
1145 #pragma region C++ for design has RAW-mode
1146 textBoxRtPortPipe->Show();
1148 textBoxDiagPortPipe->Show();
1151 textBoxDiagPortPipe->Text = piml->DefaultDiagPort.ToString();
1152 textBoxDiagPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
1154 textBoxRtPortPipe->Text = piml->DefaultRuntimePort.ToString();
1157 case IpcTypes::Pipe:
1159 portPipeLabel->Show();
1160 portPipeLabel->Text =
"Runner / DiagManager Pipes";
1162 #pragma region C++ for design has RAW-mode
1163 textBoxRtPortPipe->Show();
1165 textBoxDiagPortPipe->Show();
1168 textBoxDiagPortPipe->Text = Util::Util::ToString(piml->DefaultDiagPipeName);
1169 textBoxDiagPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
1171 textBoxRtPortPipe->Text = Util::Util::ToString(piml->DefaultRuntimePipeName);
1177 REFAPP_END_METHOD();
1180 System::Void SampleForm::textBoxPortPipe_TextChanged(System::Object^ sender, System::EventArgs^ e)
1182 REFAPP_START_METHOD();
1183 PrintTextCallback(
"Create RuntimeManager...");
1187 piml->GlobalRuntimeManager = CreateRuntimeManager();
1189 catch (
const std::exception& ex)
1192 PrintTextCallback(
"No RuntimeManager created");
1194 catch (System::Exception^ ex)
1196 System::String^ senderName = (
dynamic_cast<System::Windows::Forms::TextBox^
>(sender))->Name;
1197 if (senderName->Equals(Util::Util::ToString(SampleConstants::RT_PORT_PIPE_TEXT_BOX_NAME)))
1199 PrintTextCallback(System::String::Format(
"Invalid Otx Runtime {0}", IpcPortPipeString()));
1201 else if (senderName->Equals(Util::Util::ToString(SampleConstants::DM_PORT_PIPE_TEXT_BOX_NAME)))
1203 PrintTextCallback(System::String::Format(
"Invalid Diag Manager {0}", IpcPortPipeString()));
1207 PrintTextCallback(
"No RuntimeManager created");
1211 PrintTextCallback(
"No RuntimeManager created");
1214 if (piml->GlobalRuntimeManager ==
nullptr)
1216 PrintTextCallback(
"RuntimeManager is null.");
1218 REFAPP_END_METHOD();
1221 std::shared_ptr<IRuntimeManager> SampleForm::CreateRuntimeManager()
1223 REFAPP_START_METHOD();
1224 std::shared_ptr<IRuntimeManager> runtimeManager =
nullptr;
1227 System::String^ ipcType =
"";
1228 switch (Util::Util::ToIpcType(comboBoxIpcType->SelectedItem->ToString()))
1230 #pragma region C++ for RAW-mode
1233 runtimeManager = CreateRawRuntimeManager();
1235 if (runtimeManager ==
nullptr)
1237 REFAPP_END_METHOD();
1238 return piml->GlobalRuntimeManager;
1241 ipcType = Util::Util::ToString(IpcTypes::Raw);
1246 case IpcTypes::Socket:
1248 runtimeManager = CreateSocketRuntimeManager();
1249 ipcType = Util::Util::ToString(IpcTypes::Socket);
1252 case IpcTypes::Pipe:
1254 runtimeManager = CreatePipeRuntimeManager();
1255 ipcType = Util::Util::ToString(IpcTypes::Pipe);
1259 PrintTextCallback(System::String::Format(
"... {0} RuntimeManager created (MinBinVersion: {1})", ipcType, Util::Util::ToString(RuntimeConfig::GetInstance().GetMinBinVersion())));
1261 InitializeRuntimeEvents(runtimeManager);
1262 SetCustomImplementation(runtimeManager);
1264 catch (
const std::exception& ex)
1267 PrintTextCallback(
"... No RuntimeManager created.");
1269 REFAPP_END_METHOD();
1270 return runtimeManager;
1272 catch (System::Exception^ ex)
1275 PrintTextCallback(
"... No RuntimeManager created.");
1277 REFAPP_END_METHOD();
1278 return runtimeManager;
1282 PrintTextCallback(
"... No RuntimeManager created.");
1284 REFAPP_END_METHOD();
1285 return runtimeManager;
1288 REFAPP_END_METHOD();
1289 return runtimeManager;
1292 System::String^ SampleForm::IpcPortPipeString()
1294 IpcTypes ipcType = Util::Util::ToIpcType(comboBoxIpcType->SelectedItem->ToString());
1297 case IpcTypes::Socket:
1298 return Util::Util::ToString(SampleConstants::PORT_STRING);
1299 case IpcTypes::Pipe:
1300 return Util::Util::ToString(SampleConstants::PIPE_STRING);
1303 return System::String::Empty;
1307 std::shared_ptr<IRuntimeManager> SampleForm::CreateSocketRuntimeManager()
1309 REFAPP_START_METHOD();
1310 unsigned short rtPort = System::Convert::ToUInt16(textBoxRtPortPipe->Text);
1314 return RuntimeManagerFactory::CreateSocketRuntimeManager(rtPort);
1318 unsigned short diagPort = System::Convert::ToUInt16(textBoxDiagPortPipe->Text);
1319 return RuntimeManagerFactory::CreateSocketRuntimeManager(rtPort, diagPort);
1321 REFAPP_END_METHOD();
1324 std::shared_ptr<IRuntimeManager> SampleForm::CreatePipeRuntimeManager()
1326 REFAPP_START_METHOD();
1329 return RuntimeManagerFactory::CreatePipeRuntimeManager(Util::Util::ToString(textBoxRtPortPipe->Text));
1333 return RuntimeManagerFactory::CreatePipeRuntimeManager(Util::Util::ToString(textBoxRtPortPipe->Text), Util::Util::ToString(textBoxDiagPortPipe->Text));
1335 REFAPP_END_METHOD();
1338 bool SampleForm::NoDiag()
1340 return System::String::IsNullOrWhiteSpace(textBoxDiagPortPipe->Text);
1343 void SampleForm::InitializeRuntimeEvents(std::shared_ptr<IRuntimeManager> runtimeManager)
1345 REFAPP_START_METHOD();
1346 if (runtimeManager ==
nullptr)
1351 piml->InitializeRuntimeEvents(runtimeManager);
1353 PrintTextCallback(
"Initialization of runtime events finished");
1354 REFAPP_END_METHOD();
1357 System::Void SampleForm::radioButtonCustomImpl_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
1359 REFAPP_START_METHOD();
1360 if (piml->GlobalRuntimeManager ==
nullptr)
1362 REFAPP_END_METHOD();
1366 if (sender !=
nullptr && (
dynamic_cast<System::Windows::Forms::RadioButton^
>(sender))->Checked ==
false)
1368 REFAPP_END_METHOD();
1372 SetCustomImplementation(piml->GlobalRuntimeManager);
1373 REFAPP_END_METHOD();
1376 void SampleForm::SetCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
1378 REFAPP_START_METHOD();
1379 if (runtimeManager ==
nullptr)
1381 REFAPP_END_METHOD();
1385 System::String^ type =
"";
1386 CustomImplTypes currentCustomImpl = GetCurrentCustomImpl();
1387 switch (currentCustomImpl)
1391 SetOutputWindowImplementation(runtimeManager);
1395 case DefaultCustomImpl:
1397 SetDefaultCustomImplementation(runtimeManager);
1403 RemoveCustomImplementation(runtimeManager);
1411 if (currentCustomImpl != CustomImplTypes::None)
1413 PrintTextCallback(
"Set up " + type +
"custom implementation finished");
1415 REFAPP_END_METHOD();
1418 CustomImplTypes SampleForm::GetCurrentCustomImpl()
1420 if (radioButtonOuputWindow->Checked)
1422 return CustomImplTypes::OutputImpl;
1424 else if (radioButtonDefaultImplementation->Checked)
1426 return CustomImplTypes::DefaultCustomImpl;
1428 else if (radioButtonNoCustomImplementation->Checked)
1430 return CustomImplTypes::NoCustom;
1433 return CustomImplTypes::None;
1436 void SampleForm::SetOutputWindowImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
1438 if (runtimeManager ==
nullptr)
1443 piml->SetOutputWindowImplementation(runtimeManager);
1446 void SampleForm::SetDefaultCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
1448 if (runtimeManager ==
nullptr)
1453 piml->SetDefaultCustomImplementation(runtimeManager);
1456 void SampleForm::RemoveCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
1458 if (runtimeManager ==
nullptr)
1463 piml->RemoveCustomImplementation(runtimeManager);
1466 void SampleForm::ProcedurePendingCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1468 REFAPP_START_METHOD();
1471 Invoke(
gcnew System::Action<CLRWrapper< IRuntimeContext*>^>(
this, &SampleForm::ProcedurePendingCallback), clrContext);
1472 REFAPP_END_METHOD();
1476 msclr::lock l(piml->EventListenerLock.get());
1478 IRuntimeContext* context = clrContext->GetPtr();
1479 PrintTextCallback(System::String::Format(
"Event ProcedurePending occurred - {0} - ExecutionState = {1}",
1480 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1481 Util::Util::ToString(context->GetExecutionState())));
1482 UpdateExecutionState(context);
1483 ShowConnectionStateMessage(context);
1485 REFAPP_END_METHOD();
1488 void SampleForm::ProcedureStartedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1490 REFAPP_START_METHOD();
1493 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureStartedCallback), clrContext);
1494 REFAPP_END_METHOD();
1498 msclr::lock l(piml->EventListenerLock.get());
1500 IRuntimeContext* context = clrContext->GetPtr();
1501 PrintTextCallback(System::String::Format(
"Event ProcedureStarted occurred - {0} - ExecutionState = {1} - RuntimeId = {2} - ProcessId = {3}",
1502 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1503 Util::Util::ToString(context->GetExecutionState()),
1504 context->GetRuntimeId().ToString(),
1505 context->GetProcessId().ToString()));
1506 UpdateExecutionState(context);
1508 REFAPP_END_METHOD();
1511 void SampleForm::ProcedurePaused(IRuntimeContext* context, ExecutionStateChangeReason reason)
1513 REFAPP_START_METHOD();
1514 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
1515 arr[0] =
gcnew CLRWrapper<IRuntimeContext*>(context);
1516 arr[1] =
gcnew CLRWrapper<ExecutionStateChangeReason>(reason);
1519 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::ProcedurePausedCallback),
gcnew cli::array<System::Object^>{arr});
1523 ProcedurePausedCallback(arr);
1525 REFAPP_END_METHOD();
1528 void SampleForm::ProcedurePausedCallback(cli::array<System::Object^>^ arr)
1530 REFAPP_START_METHOD();
1531 if (arr ==
nullptr || arr->Length != 2)
1533 REFAPP_END_METHOD();
1537 IRuntimeContext* context = Util::Util::CastTo<IRuntimeContext*>(arr[0]);
1540 if (context ==
nullptr)
1542 REFAPP_END_METHOD();
1546 msclr::lock l(piml->EventListenerLock.get());
1548 PrintTextCallback(System::String::Format(
"Event ProcedurePaused occurred - {0} - ExecutionState = {1} - ExecutionStateChangeReason = {2}",
1549 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1550 Util::Util::ToString(context->GetExecutionState()),
1551 Util::Util::ToString(reason)));
1552 UpdateExecutionState(context, reason);
1553 if (reason == ExecutionStateChangeReason::UnexpectedDiagConnectionState)
1555 ShowConnectionStateMessage(context);
1558 REFAPP_END_METHOD();
1561 void SampleForm::ProcedureContinuedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1563 REFAPP_START_METHOD();
1566 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureContinuedCallback), clrContext);
1567 REFAPP_END_METHOD();
1571 msclr::lock l(piml->EventListenerLock.get());
1573 IRuntimeContext* context = clrContext->GetPtr();
1574 PrintTextCallback(System::String::Format(
"Event ProcedureContinued occurred - {0} - ExecutionState = {1}",
1575 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1576 Util::Util::ToString(context->GetExecutionState())));
1577 UpdateExecutionState(context);
1579 REFAPP_END_METHOD();
1582 void SampleForm::ProcedureStoppedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1584 REFAPP_START_METHOD();
1587 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureStoppedCallback), clrContext);
1588 REFAPP_END_METHOD();
1592 msclr::lock l(piml->EventListenerLock.get());
1594 IRuntimeContext* context = clrContext->GetPtr();
1595 PrintTextCallback(System::String::Format(
"Event ProcedureStopped occurred - {0} - ExecutionState = {1}",
1596 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1597 Util::Util::ToString(context->GetExecutionState())));
1598 UpdateExecutionState(context);
1600 REFAPP_END_METHOD();
1603 void SampleForm::ProcedureTimeoutCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1605 REFAPP_START_METHOD();
1608 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureTimeoutCallback), clrContext);
1609 REFAPP_END_METHOD();
1613 msclr::lock l(piml->EventListenerLock.get());
1615 IRuntimeContext* context = clrContext->GetPtr();
1616 PrintTextCallback(System::String::Format(
"Event ProcedureTimeout occurred - {0} - ExecutionState = {1}",
1617 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1618 Util::Util::ToString(context->GetExecutionState())));
1620 UpdateExecutionState(context);
1622 REFAPP_END_METHOD();
1625 void SampleForm::DiagConnectionStateChanged(ClampState batteryState, ClampState ignitionState)
1627 REFAPP_START_METHOD();
1628 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
1629 arr[0] =
gcnew CLRWrapper<ClampState>(batteryState);
1630 arr[1] =
gcnew CLRWrapper<ClampState>(ignitionState);
1633 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::DiagConnectionStateChangedCallback),
gcnew cli::array<System::Object^>{arr});
1637 DiagConnectionStateChangedCallback(arr);
1639 REFAPP_END_METHOD();
1642 void SampleForm::DiagConnectionStateChangedCallback(cli::array<System::Object^>^ arr)
1644 REFAPP_START_METHOD();
1646 if (arr ==
nullptr || arr->Length != 2)
1648 REFAPP_END_METHOD();
1652 ClampState batteryState = Util::Util::CastToEnum<ClampState>(arr[0]);
1653 ClampState ignitionState = Util::Util::CastToEnum<ClampState>(arr[1]);
1656 msclr::lock l(piml->EventListenerLock.get());
1658 PrintTextCallback(System::String::Format(
"Event DiagConnectionStateChanged occurred - BatteryState = {0}, IgnitionState = {1}",
1659 Util::Util::ToString(batteryState),
1660 Util::Util::ToString(ignitionState)));
1661 System::Media::SystemSounds::Beep->Play();
1663 SetBatteryIgnitionState(batteryState, ignitionState);
1665 REFAPP_END_METHOD();
1669 void SampleForm::ProcedureFinishedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1671 REFAPP_START_METHOD();
1675 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureFinishedCallback), clrContext);
1676 REFAPP_END_METHOD();
1680 msclr::lock l(piml->EventListenerLock.get());
1682 IRuntimeContext* context = clrContext->GetPtr();
1683 std::shared_ptr<IProcedureParameter> procedureParameter;
1684 std::string procedureName = context->GetProcedure()->GetFullName();
1685 std::string parameterOutput;
1687 for (
int i = 0; i < context->GetProcedure()->GetParameters().size(); i++)
1689 procedureParameter = context->GetProcedure()->GetParameters().at(i);
1690 parameterOutput =
"Parameter Changed - " + procedureParameter->GetName() +
"(" + procedureParameter->GetDataType() +
") = ";
1692 if (IS_NOT_NULL(procedureParameter->GetValue()))
1694 parameterOutput += ShortenedValueString(procedureParameter->GetValue());
1698 parameterOutput +=
"";
1701 PrintTextCallback(Util::Util::ToString(parameterOutput));
1703 System::DateTime duration = System::DateTime::Now.Subtract(System::TimeSpan(piml->RuntimeContextIdsExecutionStartTick[context->GetRuntimeId()]));
1704 UpdateGridviewParameter(context->GetProcedure());
1706 System::String^ stringRunningTime;
1708 if (System::Double::TryParse(context->GetExecutionTime().ToString(), runningTime) ==
false)
1712 stringRunningTime = System::DateTime().AddMilliseconds(runningTime).ToString(
"HH':'mm':'ss','fff");
1714 PrintTextCallback(System::String::Format(
"ProcedureFinished({0}) ExecutionState({1}) - Execution duration {2} - Running time {3} - Used memory {4})",
1715 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1716 Util::Util::ToString(context->GetExecutionState()),
1717 duration.ToString(
"HH':'mm':'ss','fff"),
1719 System::String::Format(
"{0:0,0} kB", context->GetProcessMemory() / 1024))
1722 UpdateExecutionState(context);
1724 piml->CyclicExecuteAsyncIsProcessing =
false;
1726 REFAPP_END_METHOD();
1729 void SampleForm::ProcedureAbortedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1731 REFAPP_START_METHOD();
1734 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureAbortedCallback), clrContext);
1735 REFAPP_END_METHOD();
1739 IRuntimeContext* context = clrContext->GetPtr();
1740 PrintTextCallback(System::String::Format(
"ProcedureAborted({0}) ExecutionState({1})",
1741 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1742 Util::Util::ToString(context->GetExecutionState())));
1744 if (context->HasRuntimeException())
1746 PrintException(context->GetRuntimeException(),
"Reason: API ");
1749 if (context->HasOtxException())
1751 PrintException(context->GetOtxException(),
"Reason: OTX ");
1753 piml->CyclicExecuteAsyncIsProcessing =
false;
1754 UpdateExecutionState(context);
1755 REFAPP_END_METHOD();
1758 void SampleForm::UpdateExecutionState(IRuntimeContext* context, ExecutionStateChangeReason reason)
1760 REFAPP_START_METHOD();
1761 if (context->GetExecutionState() == OpenTestSystem::Otx::Runtime::Api::ExecutionState::Paused)
1763 piml->ProcedureExecutionCount--;
1764 if (reason == ExecutionStateChangeReason::Explicit)
1766 DisplayProcedureExecutionState(context);
1769 UpdatePauseButton(
false, reason == ExecutionStateChangeReason::Explicit);
1773 UpdateExecutionState(context);
1775 REFAPP_END_METHOD();
1778 void SampleForm::UpdateExecutionState(IRuntimeContext* context)
1780 REFAPP_START_METHOD();
1781 if (context !=
nullptr)
1783 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
1785 switch (context->GetExecutionState())
1787 case ExecutionState::Running:
1789 piml->ProcedureExecutionCount++;
1791 AddRuntimeContext(context);
1792 DisplayProcedureExecutionState(context);
1794 buttonExecuteMain->Enabled = checkBoxAsyncExecution->Checked;
1795 buttonExecuteSelectedProcedure->Enabled = checkBoxAsyncExecution->Checked;
1797 UpdateExecutionStateButtons(
true);
1798 UpdatePauseButton(
true);
1802 case ExecutionState::Paused:
1804 piml->ProcedureExecutionCount--;
1805 UpdatePauseButton(
false);
1809 case ExecutionState::Pending:
1811 DisplayProcedureExecutionState(context);
1812 UpdateExecutionStateButtons(
true);
1813 UpdatePauseButton(
true,
false);
1817 case ExecutionState::Finished:
1819 piml->ProcedureExecutionCount--;
1821 RemoveRuntimeContext(context);
1822 DisplayProcedureExecutionState(context);
1824 buttonExecuteMain->Enabled = !checkBoxCyclicExecution->Checked;
1825 buttonExecuteSelectedProcedure->Enabled = !checkBoxCyclicExecution->Checked;
1827 UpdateExecutionStateButtons(
false);
1828 UpdatePauseButton(
true,
false);
1830 labelBatteryState->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16"));
1831 labelVoltageThreshold->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16"));
1835 case ExecutionState::Stopped:
1837 piml->ProcedureExecutionCount--;
1839 RemoveRuntimeContext(context);
1840 DisplayProcedureExecutionState(context);
1842 buttonExecuteMain->Enabled =
true;
1843 buttonExecuteSelectedProcedure->Enabled =
true;
1845 UpdateExecutionStateButtons(
false);
1846 UpdatePauseButton(
true,
false);
1848 labelBatteryState->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16"));
1849 labelVoltageThreshold->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16"));
1853 case ExecutionState::Aborted:
1855 piml->ProcedureExecutionCount--;
1857 RemoveRuntimeContext(context);
1858 DisplayProcedureExecutionState(context);
1860 buttonExecuteMain->Enabled =
true;
1861 buttonExecuteSelectedProcedure->Enabled =
true;
1863 UpdateExecutionStateButtons(
false);
1864 UpdatePauseButton(
true,
false);
1866 labelBatteryState->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16"));
1867 labelVoltageThreshold->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16"));
1870 case ExecutionState::Timeout:
1872 System::Media::SystemSounds::Hand->Play();
1874 piml->ProcedureExecutionCount--;
1876 RemoveRuntimeContext(context);
1877 DisplayProcedureExecutionState(context);
1879 buttonExecuteMain->Enabled =
true;
1880 buttonExecuteSelectedProcedure->Enabled =
true;
1882 UpdateExecutionStateButtons(
false);
1883 UpdatePauseButton(
true,
false);
1885 labelBatteryState->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16"));
1886 labelVoltageThreshold->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16"));
1891 StartStopUpdateGuiTimer();
1893 REFAPP_END_METHOD();
1896 void SampleForm::StartStopUpdateGuiTimer()
1898 if (piml->ProcedureExecutionCount <= 0)
1900 updateGuiTimer->Enabled =
false;
1901 labelSeparator1->Visible =
false;
1902 labelProcedureExecutionTimes->Visible =
false;
1904 else if (!updateGuiTimer->Enabled)
1906 updateGuiTimer->Enabled =
true;
1910 System::Void SampleForm::updateGuiTimer_Tick(System::Object^ sender, System::EventArgs^ e)
1912 DisplayProcedureExecutionTimes();
1915 void SampleForm::DisplayProcedureExecutionTimes()
1917 REFAPP_START_METHOD();
1918 System::String^ text = System::String::Empty;
1920 if (piml->RuntimeContextIdsExecutionStartTick.size() > 0)
1922 for (std::map<long long, long long>::iterator itr = piml->RuntimeContextIdsExecutionStartTick.begin();
1923 itr != piml->RuntimeContextIdsExecutionStartTick.end(); ++itr)
1925 System::TimeSpan duration = System::TimeSpan(System::DateTime::Now.Ticks - itr->second);
1926 text += System::String::Format(
"{0}: {1} |",
1927 Util::Util::ToString(GetRuntimeContext(itr->first)->GetProcedure()->GetName()),
1928 duration.ToString(
"hh':'mm':'ss"));
1930 text = text->TrimEnd(
gcnew cli::array<wchar_t>{
' ',
'|'});
1933 labelProcedureExecutionTimes->Text = text;
1934 labelSeparator1->Visible =
true;
1935 labelProcedureExecutionTimes->Visible =
true;
1936 REFAPP_END_METHOD();
1939 void SampleForm::InOutParameterValueChanged(IRuntimeContext* context, IProcedureInOutParameter* parameter)
1941 REFAPP_START_METHOD();
1942 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
1943 arr[0] =
gcnew CLRWrapper<IRuntimeContext*>(context);
1944 arr[1] =
gcnew CLRWrapper<IProcedureInOutParameter*>(parameter);
1947 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::InOutParameterValueChangedCallback),
gcnew cli::array<System::Object^>{arr});
1951 InOutParameterValueChangedCallback(arr);
1953 REFAPP_END_METHOD();
1956 void SampleForm::InOutParameterValueChangedCallback(cli::array<System::Object^>^ arr)
1958 REFAPP_START_METHOD();
1960 if (arr ==
nullptr || arr->Length != 2)
1962 REFAPP_END_METHOD();
1966 IRuntimeContext* context = Util::Util::CastTo<IRuntimeContext*>(arr[0]);
1967 IProcedureInOutParameter* parameter = Util::Util::CastTo<IProcedureInOutParameter*>(arr[1]);
1969 if (context ==
nullptr || parameter ==
nullptr)
1971 REFAPP_END_METHOD();
1975 msclr::lock l(piml->EventListenerLock.get());
1979 std::string valueStr = ShortenedValueString(parameter->GetValue());
1980 System::String^ message = System::String::Format(
"Parameter '{0}' new value = {1}",
1981 Util::Util::ToString(parameter->GetName()),
1982 Util::Util::ToString(valueStr));
1983 PrintTextCallback(message);
1984 UpdateGridviewParameter(context->GetProcedure());
1986 catch (
const std::exception& ex)
1988 PrintTextCallback(Util::Util::ToString(ex.what()));
1990 catch (System::InvalidCastException^ ex)
1992 PrintTextCallback(ex->Message);
1995 REFAPP_END_METHOD();
1998 std::string SampleForm::ShortenedValueString(std::shared_ptr<DataTypes::Object> value)
2002 std::string valueStr = ValueConverter::Value2String(value);
2003 if (valueStr.size() > piml->VALUE_STRING_MAX_LENGTH)
2005 return valueStr.substr(0, piml->VALUE_STRING_MAX_LENGTH) +
"...";
2017 void SampleForm::UpdatePauseButton(
bool pauseAvailable)
2019 UpdatePauseButton(pauseAvailable,
true);
2022 void SampleForm::UpdatePauseButton(
bool pauseAvailable,
bool enabled)
2024 REFAPP_START_METHOD();
2025 #pragma region C++ for initialize resources
2026 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
2029 buttonPause->Enabled = enabled;
2030 buttonPause->Checked = !pauseAvailable;
2031 buttonPause->Image = pauseAvailable ?
2032 (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonPause.Image"))) :
2033 (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonContinue.Image")));
2034 REFAPP_END_METHOD();
2037 void SampleForm::UpdateExecutionStateButtons(
bool wasExecuted)
2039 if (piml->UseConnectionState)
2041 labelTimeout->Enabled = !wasExecuted;
2042 textBoxTimeout->Enabled = !wasExecuted;
2043 checkBoxUseConnectionState->Enabled = !wasExecuted;
2044 labelExpectedState->Enabled = !wasExecuted;
2045 checkBoxIgnition->Enabled = !wasExecuted;
2046 labelPollingTime->Enabled = !wasExecuted;
2047 textBoxPollingTime->Enabled = !wasExecuted;
2048 labelVoltageThreshold->Enabled = !wasExecuted;
2049 textBoxVoltageThreshold->Enabled = !wasExecuted;
2054 if (checkBoxAsyncExecution->Checked ==
false)
2056 buttonExecuteMain->Enabled =
false;
2057 buttonExecuteSelectedProcedure->Enabled =
false;
2060 buttonStop->Enabled =
true;
2064 if (IS_NOT_NULL(piml->Project) && IS_NOT_NULL(piml->Project->GetMainProcedure()))
2066 buttonExecuteMain->Enabled =
true;
2069 buttonExecuteSelectedProcedure->Enabled =
true;
2071 buttonStop->Enabled =
false;
2075 void SampleForm::DisplayProcedureExecutionState(IRuntimeContext* context)
2077 DisplayProcedureExecutionState(context,
"");
2080 void SampleForm::DisplayProcedureExecutionState(IRuntimeContext* context, System::String^ errorMessage)
2082 REFAPP_START_METHOD();
2083 #pragma region C++ for intialize resource
2084 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
2087 if (System::String::IsNullOrEmpty(errorMessage))
2089 labelIconProcedureExecutionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"Info16")));
2091 if (piml->ProcedureExecutionCount <= 0)
2093 piml->ProcedureExecutionCount = 0;
2094 if (context->GetExecutionState() == ExecutionState::Paused)
2096 labelProcedureExecutionState->Text =
"Execution is paused, click \"Continue\"...";
2100 labelProcedureExecutionState->Text =
"Select a procedure and click \"Start\"...";
2103 else if (piml->ProcedureExecutionCount == 1)
2105 labelProcedureExecutionState->Text =
"1 Procedure is running";
2109 labelProcedureExecutionState->Text = System::String::Format(
"{0} Procedures are running", piml->ProcedureExecutionCount);
2114 labelIconProcedureExecutionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"Error16")));
2115 labelProcedureExecutionState->Text = errorMessage;
2117 REFAPP_END_METHOD();
2120 void SampleForm::SyncWithParent(System::Object^ parentControl)
2122 REFAPP_START_METHOD();
2123 SyncWithParent(parentControl,
nullptr);
2124 REFAPP_END_METHOD();
2127 void SampleForm::SyncWithParent(System::Object^ parentControl, System::Object^ control)
2129 REFAPP_START_METHOD();
2130 SyncWithParent(parentControl, control,
false);
2131 REFAPP_END_METHOD();
2134 void SampleForm::SyncWithParent(System::Object^ parentControl, System::Object^ control,
bool newThread)
2136 REFAPP_START_METHOD();
2137 if (parentControl !=
nullptr)
2139 if (IS_NOT_NULL(piml->CreatorForm) && checkBoxStartAllParents->Checked)
2141 if (Util::Util::IsInstance<System::Windows::Forms::Button^>(parentControl))
2145 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentButtonClickCallback), parentControl);
2149 ParentButtonClickCallback(parentControl);
2152 else if (Util::Util::IsInstance<System::Windows::Forms::TextBox^>(parentControl) && Util::Util::IsInstance<System::Windows::Forms::TextBox^>(control))
2154 cli::array<System::Object^>^ state =
gcnew cli::array<System::Object^>(2);
2155 state[0] = parentControl;
2156 state[1] = (
dynamic_cast<System::Windows::Forms::TextBox^
>(control))->Text;
2159 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentTextBoxSetTextCallback), state);
2163 ParentTextBoxSetTextCallback(state);
2166 else if (Util::Util::IsInstance<System::Windows::Forms::CheckBox^>(parentControl) && Util::Util::IsInstance<System::Windows::Forms::CheckBox^>(control))
2168 cli::array<System::Object^>^ state =
gcnew cli::array<System::Object^>(2);
2169 state[0] = parentControl;
2170 state[1] = (
dynamic_cast<System::Windows::Forms::CheckBox^
> (control))->CheckState;
2173 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentCheckBoxSetCheckStateCallback), state);
2177 ParentCheckBoxSetCheckStateCallback(state);
2180 else if (Util::Util::IsInstance<System::Windows::Forms::ComboBox^>(parentControl) && Util::Util::IsInstance<System::Windows::Forms::ComboBox^>(control))
2182 cli::array<System::Object^>^ state =
gcnew cli::array<System::Object^>(2);
2183 state[0] = parentControl;
2184 state[1] = (
dynamic_cast<System::Windows::Forms::ComboBox^
>(control))->SelectedIndex;
2187 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentComboBoxSetIndexCallback), state);
2191 ParentComboBoxSetIndexCallback(state);
2194 else if (Util::Util::IsInstance<System::Windows::Forms::NumericUpDown^>(parentControl) && Util::Util::IsInstance<System::Windows::Forms::NumericUpDown^>(control))
2196 cli::array<System::Object^>^ state =
gcnew cli::array<System::Object^>(2);
2197 state[0] = parentControl;
2198 state[1] = System::Decimal::ToInt32((
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(control))->Value);
2201 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentNumericUpDownSetValueCallback), state);
2205 ParentNumericUpDownSetValueCallback(state);
2210 REFAPP_END_METHOD();
2213 void SampleForm::ParentButtonClickCallback(System::Object^ state)
2215 REFAPP_START_METHOD();
2216 System::Windows::Forms::Button^ parentButton =
dynamic_cast<System::Windows::Forms::Button^
> (state);
2217 if (parentButton ==
nullptr)
2219 REFAPP_END_METHOD();
2223 if (parentButton->InvokeRequired)
2225 piml->CreatorForm->Invoke(
gcnew System::Action<System::Object^>(
this, &SampleForm::ParentButtonClickCallback), parentButton);
2229 parentButton->PerformClick();
2231 REFAPP_END_METHOD();
2234 void SampleForm::TextBoxSetTextCallback(cli::array<System::Object^>^ arr)
2236 REFAPP_START_METHOD();
2237 if (arr ==
nullptr || arr->Length != 2)
2239 REFAPP_END_METHOD();
2243 System::Windows::Forms::TextBox^ parentTextBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(arr[0]);
2244 System::Windows::Forms::TextBox^ textBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(arr[1]);
2246 if (parentTextBox ==
nullptr || textBox ==
nullptr)
2248 REFAPP_END_METHOD();
2252 parentTextBox->Text = textBox->Text;
2253 REFAPP_END_METHOD();
2256 void SampleForm::ParentTextBoxSetTextCallback(System::Object^ state)
2258 REFAPP_START_METHOD();
2259 cli::array<System::Object^>^ arr =
dynamic_cast<cli::array<System::Object^>^
>(state);
2260 if (arr ==
nullptr || arr->Length != 2)
2262 REFAPP_END_METHOD();
2266 System::Windows::Forms::TextBox^ parentTextBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(arr[0]);
2267 System::Windows::Forms::TextBox^ textBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(arr[1]);
2269 if (parentTextBox ==
nullptr || textBox ==
nullptr)
2271 REFAPP_END_METHOD();
2275 if (parentTextBox->InvokeRequired)
2277 piml->CreatorForm->Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::TextBoxSetTextCallback),
gcnew cli::array<System::Object^>{arr});
2281 TextBoxSetTextCallback(arr);
2283 REFAPP_END_METHOD();
2286 void SampleForm::CheckBoxSetCheckStateCallback(cli::array<System::Object^>^ arr)
2288 REFAPP_START_METHOD();
2289 if (arr ==
nullptr || arr->Length != 2)
2291 REFAPP_END_METHOD();
2295 System::Windows::Forms::CheckBox^ parentCheckBox =
dynamic_cast<System::Windows::Forms::CheckBox^
>(arr[0]);
2296 System::Windows::Forms::CheckBox^ checkBox =
dynamic_cast<System::Windows::Forms::CheckBox^
>(arr[1]);
2297 if (parentCheckBox ==
nullptr || checkBox ==
nullptr)
2299 REFAPP_END_METHOD();
2303 parentCheckBox->CheckState = checkBox->CheckState;
2304 REFAPP_END_METHOD();
2307 void SampleForm::ParentCheckBoxSetCheckStateCallback(System::Object^ state)
2309 REFAPP_START_METHOD();
2310 cli::array<System::Object^>^ arr =
dynamic_cast<cli::array<System::Object^>^
>(state);
2311 if (arr ==
nullptr || arr->Length != 2)
2313 REFAPP_END_METHOD();
2317 System::Windows::Forms::CheckBox^ parentCheckBox =
dynamic_cast<System::Windows::Forms::CheckBox^
>(arr[0]);
2318 System::Windows::Forms::CheckBox^ checkBox =
dynamic_cast<System::Windows::Forms::CheckBox^
>(arr[1]);
2320 if (parentCheckBox ==
nullptr || checkBox ==
nullptr)
2322 REFAPP_END_METHOD();
2326 if (checkBox->InvokeRequired)
2328 piml->CreatorForm->Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::CheckBoxSetCheckStateCallback),
gcnew cli::array<System::Object^>{arr});
2332 CheckBoxSetCheckStateCallback(arr);
2334 REFAPP_END_METHOD();
2337 void SampleForm::ComboBoxSetIndexCallback(cli::array<System::Object^>^ arr)
2339 REFAPP_START_METHOD();
2340 if (arr ==
nullptr || arr->Length != 2)
2342 REFAPP_END_METHOD();
2346 System::Windows::Forms::ComboBox^ parentComboBox =
dynamic_cast<System::Windows::Forms::ComboBox^
>(arr[0]);
2347 System::Windows::Forms::ComboBox^ comboBox =
dynamic_cast<System::Windows::Forms::ComboBox^
>(arr[1]);
2349 if (parentComboBox ==
nullptr || comboBox ==
nullptr)
2351 REFAPP_END_METHOD();
2355 parentComboBox->SelectedIndex = comboBox->SelectedIndex;
2356 REFAPP_END_METHOD();
2359 void SampleForm::ParentComboBoxSetIndexCallback(System::Object^ state)
2361 REFAPP_START_METHOD();
2362 cli::array<System::Object^>^ arr =
dynamic_cast<cli::array<System::Object^>^
>(state);
2363 if (arr ==
nullptr || arr->Length != 2)
2365 REFAPP_END_METHOD();
2369 System::Windows::Forms::ComboBox^ parentComboBox =
dynamic_cast<System::Windows::Forms::ComboBox^
>(arr[0]);
2370 System::Windows::Forms::ComboBox^ comboBox =
dynamic_cast<System::Windows::Forms::ComboBox^
>(arr[1]);
2372 if (parentComboBox ==
nullptr || comboBox ==
nullptr)
2377 if (parentComboBox->InvokeRequired)
2379 piml->CreatorForm->Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::ComboBoxSetIndexCallback),
gcnew cli::array<System::Object^>{arr});
2383 ComboBoxSetIndexCallback(arr);
2385 REFAPP_END_METHOD();
2388 System::Void SampleForm::buttonBrowseTraceFolder_Click(System::Object^ sender, System::EventArgs^ e)
2390 REFAPP_START_METHOD();
2391 folderBrowserDialog1->SelectedPath = textBoxTraceFolder->Text;
2392 folderBrowserDialog1->ShowNewFolderButton =
true;
2394 System::Windows::Forms::DialogResult result = folderBrowserDialog1->ShowDialog();
2395 if (result == System::Windows::Forms::DialogResult::OK)
2397 textBoxTraceFolder->Text = folderBrowserDialog1->SelectedPath;
2399 REFAPP_END_METHOD();
2402 System::Void SampleForm::buttonOpenTraceFolder_Click(System::Object^ sender, System::EventArgs^ e)
2404 REFAPP_START_METHOD();
2405 System::String^ path = textBoxTraceFolder->Text;
2406 if (System::IO::Directory::Exists(path))
2408 System::Diagnostics::Process::Start(path);
2410 REFAPP_END_METHOD();
2414 System::Void SampleForm::textBoxTraceFolder_TextChanged(System::Object^ sender, System::EventArgs^ e)
2416 REFAPP_START_METHOD();
2417 if (piml ==
nullptr || piml->GlobalRuntimeManager ==
nullptr)
2419 REFAPP_END_METHOD();
2423 std::string path = Util::Util::ToString(textBoxTraceFolder->Text);
2425 if (path._Equal(RuntimeConfig::GetInstance().GetTraceFolder()) ==
false)
2427 if (System::IO::Directory::Exists(Util::Util::ToString(path)))
2429 RuntimeConfig::GetInstance().SetTraceFolder(Util::Util::ToString(textBoxTraceFolder->Text));
2430 buttonOpenTraceFolder->Enabled =
true;
2432 PrintTextCallback(
"Set trace folder to " + Util::Util::ToString(RuntimeConfig::GetInstance().GetTraceFolder()));
2436 buttonOpenTraceFolder->Enabled =
false;
2441 buttonOpenTraceFolder->Enabled =
true;
2444 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm.get()->textBoxTraceFolder :
nullptr, textBoxTraceFolder);
2445 REFAPP_END_METHOD();
2449 System::Void SampleForm::comboBoxTraceLevel_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
2451 REFAPP_START_METHOD();
2452 if (piml->GlobalRuntimeManager ==
nullptr)
2454 REFAPP_END_METHOD();
2458 TraceLevels traceLevel = Util::Util::ToTraceLevel(comboBoxTraceLevel->SelectedItem->ToString());
2459 if (traceLevel == RuntimeConfig::GetInstance().GetTraceLevel())
2461 REFAPP_END_METHOD();
2465 RuntimeConfig::GetInstance().SetTraceLevel(traceLevel);
2466 PrintTextCallback(
"Updated trace level");
2467 REFAPP_END_METHOD();
2470 System::Void SampleForm::buttonBrowseFile_Click(System::Object^ sender, System::EventArgs^ e)
2472 REFAPP_START_METHOD();
2473 System::Windows::Forms::DialogResult result = openFileDialog1->ShowDialog();
2474 if (result == System::Windows::Forms::DialogResult::OK)
2476 cbFilePath->Text = openFileDialog1->FileName;
2478 buttonReload->PerformClick();
2480 REFAPP_END_METHOD();
2483 System::Void SampleForm::cbFilePath_TextChanged(System::Object^ sender, System::EventArgs^ e)
2485 REFAPP_START_METHOD();
2486 AddComboBoxFileOrPath(cbFilePath);
2488 if (System::String::IsNullOrWhiteSpace(cbFilePath->Text) || !System::IO::File::Exists(cbFilePath->Text->Trim()))
2490 buttonReload->Enabled =
false;
2494 buttonReload->Enabled =
true;
2497 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->cbFilePath :
nullptr, cbFilePath);
2498 REFAPP_END_METHOD();
2501 System::Void SampleForm::cbFilePath_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
2503 REFAPP_START_METHOD();
2504 if (System::String::IsNullOrWhiteSpace(cbFilePath->Text) || !System::IO::File::Exists(cbFilePath->Text->Trim()))
2506 buttonReload->Enabled =
false;
2510 buttonReload->Enabled =
true;
2511 if (piml->IsPathChanging ==
false)
2513 buttonReload->PerformClick();
2517 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->cbFilePath :
nullptr, cbFilePath);
2518 REFAPP_END_METHOD();
2521 System::Void SampleForm::buttonReload_Click(System::Object^ sender, System::EventArgs^ e)
2523 REFAPP_START_METHOD();
2524 LoadContextFile(piml->GlobalRuntimeManager);
2526 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonReload :
nullptr);
2527 REFAPP_END_METHOD();
2530 void SampleForm::LoadContextFile(std::shared_ptr<IRuntimeManager> runtimeManager)
2532 REFAPP_START_METHOD();
2533 if (System::String::IsNullOrWhiteSpace(cbFilePath->Text))
2535 REFAPP_END_METHOD();
2539 PrintTextCallback(
"Load '" + cbFilePath->Text +
"'...");
2541 if (runtimeManager ==
nullptr)
2543 PrintTextCallback(
"... No RuntimeManager exists!");
2544 REFAPP_END_METHOD();
2548 if (System::String::IsNullOrWhiteSpace(cbFilePath->Text->Trim()))
2550 PrintTextCallback(
".. wrong file name.");
2551 REFAPP_END_METHOD();
2555 SetTitle(Util::Util::ToString(piml->Title));
2560 piml->IsLoadding =
true;
2561 piml->PlayerProject =
nullptr;
2562 piml->Project =
nullptr;
2563 piml->ContextVariableImplementation->ResetAllValues();
2564 piml->StateVariableImplementation->ResetAllValues();
2567 System::String^ filePathExtension = System::IO::Path::GetExtension(cbFilePath->Text->Trim());
2568 if (filePathExtension->Contains(
"ptx"))
2570 piml->Project = LoadPtx(runtimeManager);
2572 if (IS_NOT_NULL(piml->Project))
2574 PrintTextCallback(
"... Project '" + Util::Util::ToString(piml->Project->GetName()) +
"' successfully loaded.");
2576 ClearCustomImplemetationCaches();
2578 LoadPackage(piml->Project);
2580 ReadSettings(piml->Project->GetSettings());
2582 piml->IsLoadding =
false;
2583 REFAPP_END_METHOD();
2587 else if (filePathExtension->Contains(
"ppx"))
2589 piml->PlayerProject = LoadPpx(runtimeManager);
2591 if (IS_NOT_NULL(piml->PlayerProject))
2593 ClearCustomImplemetationCaches();
2595 PrintTextCallback(
"... Player '" + Util::Util::ToString(piml->PlayerProject->GetName()) +
"' successfully loaded.");
2597 std::vector<std::shared_ptr<Project::IProject>> projects = piml->PlayerProject->GetProjects();
2598 for (
int i = 0; i < projects.size(); i++)
2600 piml->Project = projects[i];
2601 LoadPackage(projects[i]);
2604 ReadSettings(piml->PlayerProject->GetSettings());
2606 piml->IsLoadding =
false;
2607 REFAPP_END_METHOD();
2612 catch (
const std::exception& ex)
2616 catch (System::Exception^ ex)
2621 piml->IsLoadding =
false;
2622 REFAPP_END_METHOD();
2625 void SampleForm::ClearSampleGUI()
2627 treeViewOtxProject->Nodes->Clear();
2628 gridViewParameter->Rows->Clear();
2629 gridViewContext->Rows->Clear();
2630 gridViewState->Rows->Clear();
2631 gridViewSettings->Rows->Clear();
2634 void SampleForm::ClearCustomImplemetationCaches()
2636 piml->ClearCustomImplemetationCaches();
2640 std::shared_ptr<Project::IProject> SampleForm::LoadPtx(std::shared_ptr<IRuntimeManager> runtimeManager)
2642 REFAPP_START_METHOD();
2643 std::shared_ptr<Project::IProject> project =
nullptr;
2645 if (runtimeManager->IsProtected(Util::Util::ToString(cbFilePath->Text)))
2647 project = runtimeManager->LoadPtx(Util::Util::ToString(cbFilePath->Text),
2648 Util::Util::ToString(txtPassword->Text->Trim()));
2652 project = runtimeManager->LoadPtx(Util::Util::ToString(cbFilePath->Text));
2655 if (project->GetMainProcedure() !=
nullptr)
2657 buttonExecuteMain->Enabled =
true;
2660 REFAPP_END_METHOD();
2665 std::shared_ptr<Project::IPlayerProject> SampleForm::LoadPpx(std::shared_ptr<IRuntimeManager> runtimeManager)
2667 REFAPP_START_METHOD();
2668 std::shared_ptr<Project::IPlayerProject> playerProject =
nullptr;
2670 if (runtimeManager->IsProtected(Util::Util::ToString(cbFilePath->Text)))
2672 playerProject = runtimeManager->LoadPpx(
2673 Util::Util::ToString(cbFilePath->Text),
2674 Util::Util::ToString(txtPassword->Text->Trim()));
2678 playerProject = runtimeManager->LoadPpx(
2679 Util::Util::ToString(cbFilePath->Text));
2682 REFAPP_END_METHOD();
2683 return playerProject;
2687 void SampleForm::LoadPackage(std::shared_ptr<Project::IProject> project)
2689 REFAPP_START_METHOD();
2690 PrintTextCallback(
"Browse project...");
2692 std::vector<std::shared_ptr<Otx::Runtime::Api::Otx::IPackage>> packages = project->GetPackages();
2693 if (packages.size() == 0)
2695 std::shared_ptr<IDocument> document = project->GetStartupDocument();
2696 treeViewOtxProject->Nodes->Add(CreateDocumentNode(document));
2700 System::String^ treeNodeText = Util::Util::ToString(project->GetName());
2701 if (!System::String::IsNullOrWhiteSpace(Util::Util::ToString(piml->Project->GetVersion())))
2703 treeNodeText = System::String::Format(
"{0} ({1})", treeNodeText, Util::Util::ToString(project->GetVersion()));
2706 System::Windows::Forms::TreeNode^ root =
gcnew System::Windows::Forms::TreeNode(treeNodeText);
2707 root->ImageKey =
"ODFProject.bmp";
2708 root->SelectedImageKey =
"Package.bmp";
2709 for (
int i = 0; i < packages.size(); i++)
2711 root->Nodes->Add(CreatePackageNode(packages[i]));
2714 treeViewOtxProject->Nodes->Add(root);
2717 treeViewOtxProject->Enabled =
true;
2718 gridViewParameter->Enabled =
true;
2719 treeViewOtxProject->ExpandAll();
2720 treeViewOtxProject->SelectedNode = piml->StartUpNode.get();
2721 treeViewOtxProject->Focus();
2723 PrintTextCallback(
"... project browsing finished.");
2724 REFAPP_END_METHOD();
2728 System::Windows::Forms::TreeNode^ SampleForm::CreateDocumentNode(std::shared_ptr<Otx::Runtime::Api::Otx::IDocument> doc)
2730 REFAPP_START_METHOD();
2731 System::Windows::Forms::TreeNode^ documentNode =
gcnew System::Windows::Forms::TreeNode(Util::Util::ToString(doc->GetName()));
2732 documentNode->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IDocument>>(doc);
2733 documentNode->ImageKey =
"DocumentOTX16.bmp";
2734 documentNode->SelectedImageKey =
"DocumentOTX16.bmp";
2735 if (doc->IsStartup())
2737 documentNode->Text +=
" (StartUp)";
2740 std::vector<std::shared_ptr<Otx::Runtime::Api::Otx::IProcedure>> procedures = doc->GetProcedures();
2741 for (
int i = 0; i < procedures.size(); i++)
2743 System::Windows::Forms::TreeNode^ procedureNode = CreateProcedureName(procedures[i]);
2744 documentNode->Nodes->Add(procedureNode);
2745 if (doc->IsStartup() && procedures[i]->GetName()._Equal(
"main"))
2747 piml->StartUpNode = procedureNode;
2748 buttonExecuteMain->Enabled =
true;
2750 else if (IS_NULL(piml->StartUpNode))
2752 piml->StartUpNode = procedureNode;
2756 REFAPP_END_METHOD();
2757 return documentNode;
2761 System::Windows::Forms::TreeNode^ SampleForm::CreateProcedureName(std::shared_ptr<Otx::Runtime::Api::Otx::IProcedure> proc)
2763 REFAPP_START_METHOD();
2764 if (checkBoxCyclicReload->Checked &&
2765 IS_NOT_NULL(piml->ProcedureToExecute) &&
2766 piml->ProcedureToExecute->GetFullName()._Equal(proc->GetFullName()))
2768 piml->ProcedureToExecute = proc;
2771 System::Windows::Forms::TreeNode^ procedureNode =
gcnew System::Windows::Forms::TreeNode(Util::Util::ToString(proc->GetName()));
2772 procedureNode->ImageKey =
"Procedure.bmp";
2773 procedureNode->SelectedImageKey =
"Procedure.bmp";
2774 procedureNode->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IProcedure>>(proc);
2775 REFAPP_END_METHOD();
2776 return procedureNode;
2779 System::Windows::Forms::TreeNode^ SampleForm::CreatePackageNode(std::shared_ptr<Otx::Runtime::Api::Otx::IPackage> pack)
2781 REFAPP_START_METHOD();
2782 System::Windows::Forms::TreeNode^ packageNode =
gcnew System::Windows::Forms::TreeNode(Util::Util::ToString(pack->GetName()));
2783 packageNode->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IPackage>>(pack);
2784 packageNode->ImageKey =
"Package.bmp";
2785 packageNode->SelectedImageKey =
"Package.bmp";
2787 std::vector<std::shared_ptr<Otx::Runtime::Api::Otx::IDocument>> documents = pack->GetDocuments();
2788 for (
int i = 0; i < documents.size(); i++)
2790 packageNode->Nodes->Add(CreateDocumentNode(documents[i]));
2793 std::vector<std::shared_ptr<IPackage>> packages = pack->GetPackages();
2794 for (
int i = 0; i < packages.size(); i++)
2796 packageNode->Nodes->Add(CreatePackageNode(packages[i]));
2799 REFAPP_END_METHOD();
2803 System::Void SampleForm::gridView_CellContentClick(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e)
2805 REFAPP_START_METHOD();
2810 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2811 System::Windows::Forms::DataGridViewComboBoxCell^ comboBoxCell =
dynamic_cast<System::Windows::Forms::DataGridViewComboBoxCell^
>(gridView->Rows[e->RowIndex]->Cells[e->ColumnIndex]);
2812 if (comboBoxCell !=
nullptr)
2814 gridView->BeginEdit(
true);
2815 dynamic_cast<System::Windows::Forms::DataGridViewComboBoxEditingControl^
>(gridView->EditingControl)->DroppedDown =
true;
2816 REFAPP_END_METHOD();
2823 gridView_CellValueChanged(sender, e);
2824 REFAPP_END_METHOD();
2828 System::Void SampleForm::gridView_CellValueChanged(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e)
2830 REFAPP_START_METHOD();
2831 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2832 System::String^ columnName;
2834 if (gridView == gridViewParameter)
2836 columnName = dataGridViewTextBoxColumnValue->Name;
2838 else if (gridView == gridViewContext)
2840 columnName = dataGridViewTextBoxColumnContextValue->Name;
2844 REFAPP_END_METHOD();
2848 if (piml !=
nullptr &&
2849 !piml->IsLoadding &&
2851 gridView->Columns[e->ColumnIndex]->Name == columnName &&
2853 Util::Util::IsInstance<System::Windows::Forms::DataGridViewCheckBoxCell^>(gridView->Rows[e->RowIndex]->Cells[columnName]) ||
2854 Util::Util::IsInstance<System::Windows::Forms::DataGridViewComboBoxCell^>(gridView->Rows[e->RowIndex]->Cells[columnName])
2861 REFAPP_END_METHOD();
2865 System::Void SampleForm::gridViewParameter_CellValidated(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e)
2867 REFAPP_START_METHOD();
2868 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2869 if (piml !=
nullptr &&
2870 !piml->IsLoadding &&
2871 gridView !=
nullptr &&
2873 gridView->Columns[e->ColumnIndex]->Name == dataGridViewTextBoxColumnValue->Name)
2875 std::shared_ptr<IProcedureParameter> parameter = Util::Util::CastTo<std::shared_ptr<IProcedureParameter>>(gridView->Rows[e->RowIndex]->Tag);
2877 if (parameter->GetValue() !=
nullptr)
2879 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnValue->Name]->Value = ConvertValue2String(parameter->GetValue());
2880 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnDetails->Name]->Value = GetDetails(parameter->GetValue());
2883 REFAPP_END_METHOD();
2888 System::Void SampleForm::gridViewParameter_CellValidating(System::Object^ sender, System::Windows::Forms::DataGridViewCellValidatingEventArgs^ e)
2890 REFAPP_START_METHOD();
2891 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2892 if (piml !=
nullptr &&
2893 !piml->IsLoadding &&
2894 gridView !=
nullptr &&
2896 gridView->Columns[e->ColumnIndex]->Name == dataGridViewTextBoxColumnValue->Name &&
2897 !gridView->Rows[e->RowIndex]->ReadOnly &&
2898 e->FormattedValue !=
nullptr)
2900 std::shared_ptr<IProcedureParameter> parameter = Util::Util::CastTo<std::shared_ptr<IProcedureParameter>>(gridView->Rows[e->RowIndex]->Tag);
2901 if (e->FormattedValue->ToString() == Util::Util::ToString(DataTypes::ValueConverter::Value2String(parameter->GetValue())) ||
2902 e->FormattedValue->ToString() == ConvertValue2String(parameter->GetValue()))
2904 REFAPP_END_METHOD();
2908 std::shared_ptr<DataTypes::Object> value =
nullptr;
2912 value = DataTypes::ValueConverter::String2Value(Util::Util::ToString(e->FormattedValue->ToString()), parameter->GetDataType());
2914 catch (
const std::exception& ex)
2922 REFAPP_END_METHOD();
2925 catch (System::Exception^ ex)
2933 REFAPP_END_METHOD();
2937 if (value ==
nullptr)
2939 System::Media::SystemSounds::Exclamation->Play();
2943 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnDataType->Name]->ErrorText = System::String::Empty;
2944 if (std::shared_ptr<IProcedureInParameter> inParam = std::dynamic_pointer_cast<IProcedureInParameter>(parameter))
2946 inParam->SetValue(value);
2948 else if (std::shared_ptr<IProcedureInOutParameter> inOutParam = std::dynamic_pointer_cast<IProcedureInOutParameter>(parameter))
2950 inOutParam->SetValue(value);
2954 REFAPP_END_METHOD();
2957 System::Void SampleForm::gridViewContextVariable_CellValidated(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e)
2959 REFAPP_START_METHOD();
2960 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2961 if (piml !=
nullptr &&
2962 !piml->IsLoadding &&
2963 gridView !=
nullptr &&
2965 gridView->Columns[e->ColumnIndex]->Name == dataGridViewTextBoxColumnContextValue->Name)
2967 std::shared_ptr<IContextVariable> context = Util::Util::CastTo<std::shared_ptr<IContextVariable>>(gridView->Rows[e->RowIndex]->Tag);
2968 if (gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag !=
nullptr)
2970 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value = ConvertValue2String(Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag));
2971 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextDetails->Name]->Value = GetDetails(Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag));
2974 REFAPP_END_METHOD();
2978 System::Void SampleForm::gridViewContextVariable_CellValidating(System::Object^ sender, System::Windows::Forms::DataGridViewCellValidatingEventArgs^ e)
2980 REFAPP_START_METHOD();
2981 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2982 if (piml !=
nullptr &&
2983 !piml->IsLoadding &&
2984 gridView !=
nullptr &&
2986 gridView->Columns[e->ColumnIndex]->Name == dataGridViewTextBoxColumnContextValue->Name &&
2987 !gridView->Rows[e->RowIndex]->ReadOnly &&
2988 e->FormattedValue !=
nullptr)
2990 std::shared_ptr<IContextVariable> context = Util::Util::CastTo<std::shared_ptr<IContextVariable>>(gridView->Rows[e->RowIndex]->Tag);
2992 if (e->FormattedValue->ToString() == Util::Util::ToString(DataTypes::ValueConverter::Value2String(Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag))) ||
2993 e->FormattedValue->ToString() == ConvertValue2String(Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag)))
2995 REFAPP_END_METHOD();
2999 std::shared_ptr<DataTypes::Object> value =
nullptr;
3003 value = DataTypes::ValueConverter::String2Value(Util::Util::ToString(e->FormattedValue->ToString()), context->GetDataType());
3005 catch (System::Exception^ ex)
3013 REFAPP_END_METHOD();
3017 if (value ==
nullptr)
3019 System::Media::SystemSounds::Exclamation->Play();
3025 std::string fullNameContextVariable = context->GetDocument()->GetFullName() +
"." + context->GetName();
3026 piml->ContextVariableImplementation->SetValue(fullNameContextVariable, value);
3027 piml->_ContextVariableOutputImpl->SetValue(fullNameContextVariable, value);
3028 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(value);
3029 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextDataType->Name]->ErrorText = System::String::Empty;
3032 REFAPP_END_METHOD();
3035 System::Void SampleForm::treeViewOtxProject_AfterSelect(System::Object^ sender, System::Windows::Forms::TreeViewEventArgs^ e)
3037 REFAPP_START_METHOD();
3038 System::Windows::Forms::TreeNode^ node = e->Node;
3039 if (node !=
nullptr)
3042 gridViewParameter->Rows->Clear();
3043 gridViewContext->Rows->Clear();
3044 gridViewState->Rows->Clear();
3046 if (Util::Util::IsInstance<CLRWrapper<std::shared_ptr<IProcedure>>^>(node->Tag))
3048 std::shared_ptr<IProcedure> procedure = Util::Util::CastTo<std::shared_ptr<IProcedure>>(node->Tag);
3049 ClearCustomImplemetationCaches();
3050 UpdateGridView(procedure);
3052 buttonExecuteSelectedProcedure->Enabled =
true;
3053 piml->Project = GetProject(procedure);
3054 REFAPP_END_METHOD();
3059 buttonExecuteSelectedProcedure->Enabled =
false;
3060 REFAPP_END_METHOD();
3064 std::shared_ptr<Project::IProject> SampleForm::GetProject(std::shared_ptr<IProcedure> procedure)
3066 REFAPP_START_METHOD();
3067 if (procedure !=
nullptr)
3069 std::shared_ptr<IPackage>
package = procedure->GetDocument()->GetPackage();
3070 if (package !=
nullptr)
3072 while (package->GetParent() !=
nullptr)
3074 package = package->GetParent();
3076 REFAPP_END_METHOD();
3077 return package->GetProject();
3080 REFAPP_END_METHOD();
3084 System::Void SampleForm::treeViewOtxProject_DrawNode(System::Object^ sender, System::Windows::Forms::DrawTreeNodeEventArgs^ e)
3086 e->DrawDefault =
true;
3089 System::Void SampleForm::buttonReadSettings_Click(System::Object^ sender, System::EventArgs^ e)
3091 REFAPP_START_METHOD();
3092 std::map<std::string, std::string> settings;
3093 if (piml->PlayerProject !=
nullptr)
3095 settings = piml->PlayerProject->GetSettings();
3099 settings = piml->Project->GetSettings();
3101 ReadSettings(settings);
3102 REFAPP_END_METHOD();
3105 void SampleForm::ReadSettings(std::map<std::string, std::string> settings)
3107 REFAPP_START_METHOD();
3108 PrintTextCallback(
"Read settings");
3110 gridViewSettings->Rows->Clear();
3112 for (std::pair<std::string, std::string> it : settings)
3114 cli::array<System::String^>^ values = {
3115 Util::Util::ToString(it.first),
3116 Util::Util::ToString(it.second)
3118 gridViewSettings->Rows->Add(values);
3120 REFAPP_END_METHOD();
3124 System::Void SampleForm::buttonWriteSettings_Click(System::Object^ sender, System::EventArgs^ e)
3126 REFAPP_START_METHOD();
3127 System::String^ nameSetting;
3128 System::String^ valueSetting;
3129 int selectedSettingPosition = 0;
3130 std::map<std::string, std::string> newSettings;
3132 if (gridViewSettings->SelectedRows->Count != 0)
3134 selectedSettingPosition = gridViewSettings->SelectedRows[0]->Index;
3139 if (IS_NOT_NULL(piml->Project) || IS_NOT_NULL(piml->PlayerProject))
3141 for (
int i = 0; i < gridViewSettings->Rows->Count; i++)
3143 nameSetting = gridViewSettings->Rows[i]->Cells[dataGridViewTextBoxColumnSettingName->Name]->Value->ToString();
3145 System::Object^ cellSettingValueValue = gridViewSettings->Rows[i]->Cells[dataGridViewTextBoxColumnSettingValue->Name]->Value;
3146 valueSetting = cellSettingValueValue ==
nullptr ? nullptr : cellSettingValueValue->ToString();
3148 newSettings.insert({ Util::Util::ToString(nameSetting),Util::Util::ToString(valueSetting) });
3151 if (piml->PlayerProject !=
nullptr)
3153 piml->PlayerProject->SetSettings(newSettings);
3154 ReadSettings(piml->PlayerProject->GetSettings());
3158 piml->Project->SetSettings(newSettings);
3159 ReadSettings(piml->Project->GetSettings());
3162 gridViewSettings->Rows[selectedSettingPosition]->Selected =
true;
3163 gridViewSettings->Rows[selectedSettingPosition]->Cells[dataGridViewTextBoxColumnSettingValue->Name]->Selected =
true;
3165 PrintTextCallback(
"Write setting finished");
3168 catch (
const std::exception& ex)
3172 catch (System::Exception^ ex)
3176 REFAPP_END_METHOD();
3179 System::Void SampleForm::checkBoxCyclicExecution_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
3181 REFAPP_START_METHOD();
3182 checkBoxCyclicReload->Enabled = checkBoxCyclicExecution->Checked;
3183 checkBoxNewRuntimeManager->Enabled = checkBoxCyclicExecution->Checked;
3185 if (!checkBoxCyclicExecution->Checked)
3187 checkBoxCyclicReload->Checked =
false;
3188 checkBoxNewRuntimeManager->Checked =
false;
3191 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxCyclicExecution :
nullptr, checkBoxCyclicExecution);
3192 REFAPP_END_METHOD();
3195 System::Void SampleForm::checkBoxAsyncExecution_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
3197 REFAPP_START_METHOD();
3198 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxAsyncExecution :
nullptr, checkBoxAsyncExecution);
3199 REFAPP_END_METHOD();
3202 System::Void SampleForm::checkBoxNewRuntimeManager_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
3204 REFAPP_START_METHOD();
3205 if (checkBoxNewRuntimeManager->Checked)
3207 checkBoxCyclicReload->Checked =
true;
3210 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxNewRuntimeManager :
nullptr, checkBoxNewRuntimeManager);
3211 REFAPP_END_METHOD();
3214 System::Void SampleForm::checkBoxCyclicReload_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
3216 REFAPP_START_METHOD();
3217 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxCyclicReload :
nullptr, checkBoxCyclicReload);
3218 REFAPP_END_METHOD();
3221 System::Void SampleForm::buttonExecuteSelectedProcedure_Click(System::Object^ sender, System::EventArgs^ e)
3223 REFAPP_START_METHOD();
3226 if (treeViewOtxProject->SelectedNode !=
nullptr && Util::Util::IsInstance<CLRWrapper<std::shared_ptr<IProcedure>>^>(treeViewOtxProject->SelectedNode->Tag))
3228 std::shared_ptr<IDocument> document = Util::Util::CastTo<std::shared_ptr<IDocument>>(treeViewOtxProject->SelectedNode->Parent->Tag);
3230 piml->ProcedureToExecute = Util::Util::CastTo<std::shared_ptr<IProcedure>>(treeViewOtxProject->SelectedNode->Tag);
3235 PrintTextCallback(
"Please select Procedure to execute");
3238 catch (
const std::exception& ex)
3242 catch (System::Exception^ ex)
3247 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonExecuteSelectedProcedure :
nullptr,
nullptr,
true);
3248 REFAPP_END_METHOD();
3252 System::Void SampleForm::buttonExecuteMain_Click(System::Object^ sender, System::EventArgs^ e)
3254 REFAPP_START_METHOD();
3257 if (IS_NOT_NULL(piml->Project))
3259 treeViewOtxProject->SelectedNode = piml->StartUpNode.get();
3260 piml->ProcedureToExecute = piml->Project->GetMainProcedure();
3265 PrintTextCallback(
"There is no project has been loaded. Please reload the project");
3268 catch (
const std::exception& ex)
3272 catch (System::Exception^ ex)
3277 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonExecuteMain :
nullptr,
nullptr,
true);
3278 REFAPP_END_METHOD();
3282 void SampleForm::ExecuteProcedure()
3284 REFAPP_START_METHOD();
3285 unsigned long long timeOut = 0;
3286 PrintTextCallback(
"Start procedure execution...");
3288 if (checkBoxAsyncExecution->Checked ==
false)
3290 buttonExecuteMain->Enabled =
false;
3291 buttonExecuteSelectedProcedure->Enabled =
false;
3296 if (IS_NOT_NULL(piml->GlobalRuntimeManager) && IS_NOT_NULL(piml->ProcedureToExecute))
3298 buttonStop->Enabled =
true;
3300 CheckBatteryIgnitionState(piml->GlobalRuntimeManager);
3302 if (checkBoxCyclicExecution->Checked)
3304 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::DoCyclic),
nullptr);
3308 if (System::UInt64::TryParse(textBoxTimeout->Text->Trim(), timeOut) ==
false) {
3313 if (checkBoxAsyncExecution->Checked)
3315 piml->GlobalRuntimeManager->ExecuteAsync(
3316 Util::Util::ToString(textBoxRuntimeContextName->Text->Trim()),
3317 piml->ProcedureToExecute,
3318 piml->ExpectedConnectionState,
3324 cli::array<System::Object^>^ args =
gcnew cli::array<System::Object^>(4);
3325 args[0] = textBoxRuntimeContextName->Text->Trim();
3326 args[1] =
gcnew CLRWrapper<std::shared_ptr<IProcedure>>(piml->ProcedureToExecute);
3327 args[2] = (int)piml->ExpectedConnectionState;
3330 System::Threading::Tasks::Task::Factory->StartNew(
3331 CallbackToAction::Convert(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::ExecuteProcedureSync),
3338 PrintTextCallback(
"RuntimeManager is null or no Procedure is selected to run.");
3341 catch (System::Exception^ ex)
3345 UpdateButtonStateAfterThrowException();
3347 REFAPP_END_METHOD();
3350 void SampleForm::ExecuteProcedureSync(cli::array<System::Object^>^ args)
3352 REFAPP_START_METHOD();
3353 if (args->Length != 4)
3355 REFAPP_END_METHOD();
3359 System::String^ runtimeContextName =
dynamic_cast<System::String^
>(args[0]);
3360 std::shared_ptr<IProcedure> procedureWrapper = Util::Util::CastTo<std::shared_ptr<IProcedure>>(args[1]);
3361 int expectedState = safe_cast<int>(args[2]);
3362 unsigned long long timeout = safe_cast<unsigned long long>(args[3]);
3364 if (procedureWrapper ==
nullptr)
3366 REFAPP_END_METHOD();
3370 piml->GlobalRuntimeManager->Execute(
3371 Util::Util::ToString(runtimeContextName),
3373 (ExpectedState)expectedState,
3375 REFAPP_END_METHOD();
3378 void SampleForm::UpdateButtonStateAfterThrowException()
3380 REFAPP_START_METHOD();
3381 #pragma region C++ for initialize resource
3382 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
3385 buttonExecuteMain->Enabled = !checkBoxAsyncExecution->Checked;
3386 buttonExecuteSelectedProcedure->Enabled = !checkBoxAsyncExecution->Checked;
3388 UpdateExecutionStateButtons(
false);
3389 UpdatePauseButton(
true,
false);
3391 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16")));
3392 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16")));
3393 REFAPP_END_METHOD();
3397 void SampleForm::DoCyclic(System::Object^ args)
3399 REFAPP_START_METHOD();
3400 System::DateTime^ startTime = System::DateTime::Now;
3401 unsigned long long timeOut = 0;
3406 while (checkBoxCyclicExecution->Checked)
3408 std::shared_ptr<IRuntimeManager> runtimeManager =
nullptr;
3409 std::shared_ptr<IRuntimeContext> runtimeContext =
nullptr;
3412 piml->CyclicExecutionCount++;
3414 if (checkBoxNewRuntimeManager->Checked)
3416 runtimeManager = CreateRuntimeManager();
3420 runtimeManager = piml->GlobalRuntimeManager;
3423 CheckCyclicReloadOrNewRuntimeManager(runtimeManager);
3425 piml->CyclicExecuteAsyncIsProcessing =
true;
3426 CheckBatteryIgnitionState(piml->GlobalRuntimeManager);
3428 if (System::UInt64::TryParse(textBoxTimeout->Text->Trim(), timeOut) ==
false)
3433 if (checkBoxAsyncExecution->Checked)
3435 runtimeContext = runtimeManager->ExecuteAsync(
3436 Util::Util::ToString(textBoxRuntimeContextName->Text->Trim()),
3437 piml->ProcedureToExecute,
3438 piml->ExpectedConnectionState,
3441 if (runtimeContext !=
nullptr)
3444 System::Windows::Forms::Application::DoEvents();
3445 System::Threading::Thread::Sleep(50);
3450 runtimeContext = runtimeManager->Execute(
3451 Util::Util::ToString(textBoxRuntimeContextName->Text->Trim()),
3452 piml->ProcedureToExecute,
3453 piml->ExpectedConnectionState,
3458 if (runtimeContext->GetExecutionState() == ExecutionState::Stopped)
3460 piml->CyclicExecutionCount = 0;
3465 catch (System::Exception^ ex)
3469 UpdateButtonStateAfterThrowException();
3473 Invoke(
gcnew System::Action<CLRWrapper<std::shared_ptr<IRuntimeManager>>^>(
this, &SampleForm::ReloadContextFileCallback),
gcnew CLRWrapper<std::shared_ptr<IRuntimeManager>>(piml->GlobalRuntimeManager));
3475 PrintTextCallback(
"Cyclic execution finished");
3477 System::TimeSpan duration = System::TimeSpan(System::DateTime::Now.Ticks - startTime->Ticks);
3478 System::String^ text = System::String::Format(
"Execution Statistics: Duration {0} (hh:mm:ss) with {1} cycles and {2:0} ms per cycle",
3479 duration.ToString(
"hh':'mm':'ss"), cyclic, duration.TotalMilliseconds / cyclic);
3481 piml->CyclicExecutionCount -= cyclic;
3482 if (piml->CyclicExecutionCount < 0)
3484 piml->CyclicExecutionCount = 0;
3487 if (checkBoxAdd2Output->Checked)
3489 PrintTextCallback(text);
3493 System::Windows::Forms::MessageBox::Show(text);
3495 REFAPP_END_METHOD();
3498 void SampleForm::WaitCyclicExecuteAsyncIsProcessing()
3500 REFAPP_START_METHOD();
3501 if (checkBoxCyclicReload->Checked || checkBoxNewRuntimeManager->Checked)
3504 while (piml->CyclicExecuteAsyncIsProcessing)
3507 System::Windows::Forms::Application::DoEvents();
3508 System::Threading::Thread::Sleep(50);
3511 REFAPP_END_METHOD();
3514 void SampleForm::CheckCyclicReloadOrNewRuntimeManager(std::shared_ptr<IRuntimeManager> runtimeManager)
3516 REFAPP_START_METHOD();
3517 CheckCyclicReloadOrNewRuntimeManager(runtimeManager,
true);
3518 REFAPP_END_METHOD();
3521 void SampleForm::CheckCyclicReloadOrNewRuntimeManager(std::shared_ptr<IRuntimeManager> runtimeManager,
bool waitCyclic)
3523 REFAPP_START_METHOD();
3526 WaitCyclicExecuteAsyncIsProcessing();
3529 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
3530 arr[0] =
gcnew CLRWrapper<std::shared_ptr<IRuntimeManager>>(runtimeManager);
3531 arr[1] = waitCyclic;
3535 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::CheckCyclicReloadOrNewRuntimeManagerCallback),
gcnew cli::array<System::Object^>{arr});
3539 CheckCyclicReloadOrNewRuntimeManagerCallback(arr);
3541 REFAPP_END_METHOD();
3544 void SampleForm::CheckCyclicReloadOrNewRuntimeManagerCallback(cli::array<System::Object^>^ arr)
3546 REFAPP_START_METHOD();
3547 if (arr ==
nullptr || arr->Length != 2)
3549 REFAPP_END_METHOD();
3553 std::shared_ptr<IRuntimeManager> runtimeManager = Util::Util::CastTo<std::shared_ptr<IRuntimeManager>>(arr[0]);
3554 System::Boolean^ waitCyclic =
dynamic_cast<System::Boolean^
>(arr[1]);
3556 if (runtimeManager ==
nullptr || waitCyclic ==
nullptr)
3558 REFAPP_END_METHOD();
3562 if (checkBoxCyclicReload->Checked || checkBoxNewRuntimeManager->Checked)
3564 LoadContextFile(runtimeManager);
3567 if (checkBoxCyclicExecution->Checked)
3569 checkBoxCyclicExecution->Text =
"Cyclic (" + piml->CyclicExecutionCount.ToString() +
")";
3573 checkBoxCyclicExecution->Text =
"Cyclic";
3575 REFAPP_END_METHOD();
3579 System::Void SampleForm::buttonStop_Click(System::Object^ sender, System::EventArgs^ e)
3581 REFAPP_START_METHOD();
3582 if (piml->GlobalRuntimeManager !=
nullptr)
3584 PrintTextCallback(
"Try to stop all running procedures...");
3585 piml->GlobalRuntimeManager->StopAll();
3586 piml->ProcedureExecutionCount = 0;
3590 checkBoxCyclicExecution->Checked =
false;
3592 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonStop :
nullptr);
3593 REFAPP_END_METHOD();
3596 void SampleForm::PrintException(System::Exception^ ex)
3598 PrintException(ex,
"");
3601 void SampleForm::PrintException(System::Exception^ ex, System::String^ additionalText)
3603 PrintTextCallback(System::String::Format(
"!!! {2}{0}: {1}", ex->GetType()->Name, ex->Message, additionalText));
3604 System::Media::SystemSounds::Hand->Play();
3607 void SampleForm::PrintException(
const std::exception& ex)
3609 PrintException(ex,
"");
3612 void SampleForm::PrintException(
const std::exception& ex, System::String^ additionalText)
3614 PrintTextCallback(System::String::Format(
"!!! {2}{0}: {1}",
3616 Util::Util::ToString(ex.what()),
3618 System::Media::SystemSounds::Hand->Play();
3621 void SampleForm::PrintTextCallback(System::String^ text)
3625 Invoke(
gcnew System::Action<System::String^>(
this, &SampleForm::PrintTextCallback), text);
3629 if (!checkBoxAdd2Output->Checked)
3635 msclr::lock l(piml->PrintTextLock.get());
3637 if (listBoxOuput->Items->Count >= 10000)
3639 buttonClearOutput_Click(
nullptr,
nullptr);
3642 System::String^ prefixString = GetTimeAndDurationStringSinceLastTimeAndUpdateLastTime();
3643 System::String^ itemToAdd = prefixString + text +
"\t\t";
3645 listBoxOuput->Items->Add(itemToAdd);
3646 listBoxOuput->SelectedItems->Clear();
3647 listBoxOuput->TopIndex = listBoxOuput->Items->Count - 1;
3649 if (listBoxOuput->Items->Count >= 7500)
3651 labelOutputOverflow->Visible =
true;
3656 System::Windows::Forms::Application::DoEvents();
3660 System::String^ SampleForm::GetTimeAndDurationStringSinceLastTimeAndUpdateLastTime()
3662 System::DateTime^ now = System::DateTime::Now;
3663 System::TimeSpan duration = System::TimeSpan(now->Ticks - piml->LastTime.get()->Ticks);
3665 piml->LastTime = now;
3667 System::String^ timeDurationString = System::String::Format(
"{0:HH:mm:ss.fff} {1,6:#,##0} ms ", now, duration.TotalMilliseconds);
3668 return timeDurationString;
3671 System::Void SampleForm::buttonCopyRow_Click(System::Object^ sender, System::EventArgs^ e)
3673 REFAPP_START_METHOD();
3674 if (listBoxOuput->SelectedItems !=
nullptr)
3676 System::String^ text = System::String::Empty;
3677 for (
int i = 0; i < listBoxOuput->SelectedItems->Count; i++)
3679 text += listBoxOuput->SelectedItems[i]->ToString()->Trim(
'\t') +
"\n";
3682 System::Windows::Forms::Clipboard::SetText(text);
3684 REFAPP_END_METHOD();
3687 System::Void SampleForm::buttonClearOutput_Click(System::Object^ sender, System::EventArgs^ e)
3689 REFAPP_START_METHOD();
3690 listBoxOuput->Items->Clear();
3691 labelOutputOverflow->Visible =
false;
3692 buttonCopyRow->Enabled =
false;
3693 REFAPP_END_METHOD();
3696 void SampleForm::UpdateGridView(std::shared_ptr<IProcedure> procedure)
3698 REFAPP_START_METHOD();
3700 if (procedure ==
nullptr)
3702 REFAPP_END_METHOD();
3706 UpdateGridviewParameter(procedure);
3708 std::shared_ptr<Otx::Runtime::Api::Otx::IDocument> document = procedure->GetDocument();
3709 if (IS_NOT_NULL(document))
3711 std::vector<std::string> listItemReviewed;
3712 UpdateGridViewContextVariable(document,
false, listItemReviewed);
3714 listItemReviewed.clear();
3715 UpdateGridViewStateVariable(document,
false, listItemReviewed);
3717 REFAPP_END_METHOD();
3720 void SampleForm::UpdateGridviewParameter(std::shared_ptr<IProcedure> procedure)
3722 REFAPP_START_METHOD();
3723 std::vector<std::shared_ptr<IProcedureParameter>> parameters = procedure->GetParameters();
3724 for (
int i = 0; i < parameters.size(); i++)
3726 UpdateGridviewParameter(parameters[i]);
3728 REFAPP_END_METHOD();
3732 void SampleForm::UpdateGridviewParameter(std::shared_ptr<IProcedureParameter> parameter)
3734 REFAPP_START_METHOD();
3735 if (IS_NULL(parameter))
3737 REFAPP_END_METHOD();
3741 bool bValueWasSet =
false;
3744 System::String^ collumnName = dataGridViewTextBoxColumnName->Name;
3745 System::String^ collumnValue = dataGridViewTextBoxColumnValue->Name;
3746 System::String^ collumnDetails = dataGridViewTextBoxColumnDetails->Name;
3747 System::Windows::Forms::DataGridViewRowCollection^ rows = gridViewParameter->Rows;
3748 for (
int i = 0; i < rows->Count; i++)
3750 System::Windows::Forms::DataGridViewRow^ row = rows[i];
3751 if (row->Cells[collumnName]->Value->Equals(Util::Util::ToString(parameter->GetName())))
3755 if (parameter->GetValue() !=
nullptr)
3757 row->Cells[collumnValue]->Value = Util::Util::ToString(ValueConverter::Value2String(parameter->GetValue()));
3760 catch (System::Exception^ ex)
3762 row->Cells[collumnName]->ErrorText = ex->Message;
3765 bValueWasSet =
true;
3773 System::String^ directory = std::dynamic_pointer_cast<IProcedureInParameter>(parameter) ?
"In" :
3774 (std::dynamic_pointer_cast<IProcedureInOutParameter>(parameter) ?
3777 cli::array<System::Object^>^ values = {
3778 Util::Util::ToString(parameter->GetName()),
3780 Util::Util::ToString(parameter->GetDataType())
3782 int index = gridViewParameter->Rows->Add(values);
3784 gridViewParameter->Rows[index]->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IProcedureParameter>>(parameter);
3786 gridViewParameter->Rows[index]->ReadOnly = std::dynamic_pointer_cast<IProcedureOutParameter>(parameter) !=
nullptr || parameter->GetInitValue() ==
nullptr;
3788 if (parameter->GetDataType()._Equal(
"Boolean"))
3790 System::Windows::Forms::DataGridViewCheckBoxCell^ cell =
gcnew System::Windows::Forms::DataGridViewCheckBoxCell();
3791 cell->Value = ConvertValue2String(parameter->GetValue());
3792 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::DataTypes::Object>>(parameter->GetValue());
3793 cell->Style->NullValue =
false;
3794 cell->TrueValue =
true;
3795 cell->FalseValue =
false;
3796 gridViewParameter->Rows[index]->Cells[collumnValue] = cell;
3798 else if (std::shared_ptr<DataTypes::EnumerationElement> enumerationElement = std::dynamic_pointer_cast<DataTypes::EnumerationElement>(parameter->GetValue()))
3800 gridViewParameter->Rows[index]->Cells[collumnValue] =
gcnew System::Windows::Forms::DataGridViewComboBoxCell();
3801 System::Windows::Forms::DataGridViewComboBoxCell^ cell =
dynamic_cast<System::Windows::Forms::DataGridViewComboBoxCell^
>(gridViewParameter->Rows[index]->Cells[collumnValue]);
3802 cell->DisplayStyle = System::Windows::Forms::DataGridViewComboBoxDisplayStyle::ComboBox;
3803 cell->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
3804 cell->DisplayMember =
"Name";
3805 cell->ValueMember =
"Name";
3806 cell->DataSource = Util::Util::ArrayEnumerationElements2String(enumerationElement->GetEnumeration()->GetElements());
3807 cell->Value = ConvertValue2String(parameter->GetValue());
3808 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(parameter->GetValue());
3814 if (parameter->GetValue() !=
nullptr)
3816 gridViewParameter->Rows[index]->Cells[collumnValue]->Value = ConvertValue2String(parameter->GetValue());
3819 catch (System::Exception^ ex)
3821 gridViewParameter->Rows[index]->Cells[collumnValue]->ErrorText = ex->Message;
3825 gridViewParameter->Rows[index]->Cells[collumnDetails]->Value = GetDetails(parameter->GetValue());
3827 REFAPP_END_METHOD();
3830 System::String^ SampleForm::ConvertValue2String(std::shared_ptr<DataTypes::Object> value)
3832 if (value ==
nullptr)
3834 return System::String::Empty;
3837 return Util::Util::ToString(ValueConverter::Value2String(value));
3840 System::String^ SampleForm::GetDetails(std::shared_ptr<DataTypes::Object> value)
3842 REFAPP_START_METHOD();
3843 if (value ==
nullptr)
3845 REFAPP_END_METHOD();
3846 return System::String::Empty;
3849 if (std::shared_ptr<DataTypes::TranslationKey> translationKey = std::dynamic_pointer_cast<DataTypes::TranslationKey>(value))
3851 if (!translationKey->GetTextIdMappingName().empty())
3853 REFAPP_END_METHOD();
3854 return System::String::Format(
"MappingName: {0}", Util::Util::ToString(translationKey->GetTextIdMappingName()));
3857 else if (std::shared_ptr<DataTypes::EnumerationElement> enumerationElement = std::dynamic_pointer_cast<DataTypes::EnumerationElement>(value))
3859 if (IS_NOT_NULL(enumerationElement->GetTranslationKey()))
3861 if (!enumerationElement->GetTranslationKey()->GetTextId().empty() && !enumerationElement->GetTranslationKey()->GetTextIdMappingName().empty())
3863 REFAPP_END_METHOD();
3864 return System::String::Format(
"TextId: {0}, MappingName: {1}",
3865 Util::Util::ToString(enumerationElement->GetTranslationKey()->GetTextId()),
3866 Util::Util::ToString(enumerationElement->GetTranslationKey()->GetTextIdMappingName()));
3868 else if (!enumerationElement->GetTranslationKey()->GetTextId().empty())
3870 REFAPP_END_METHOD();
3871 return System::String::Format(
"TextId: {0}",
3872 Util::Util::ToString(enumerationElement->GetTranslationKey()->GetTextId()));
3875 REFAPP_END_METHOD();
3876 return System::String::Format(
"MappingName: {0}",
3877 Util::Util::ToString(enumerationElement->GetTranslationKey()->GetTextIdMappingName()));
3881 REFAPP_END_METHOD();
3882 return System::String::Empty;
3886 void SampleForm::UpdateGridViewContextVariable(std::shared_ptr<IDocument> document,
bool withPrefix, std::vector<std::string>& listItemReviewed)
3888 REFAPP_START_METHOD();
3889 std::string documentFullName = document->GetPackage()->GetName() +
"." + document->GetName();
3890 if (std::find(listItemReviewed.begin(), listItemReviewed.end(), documentFullName) != listItemReviewed.end())
3892 REFAPP_END_METHOD();
3896 listItemReviewed.push_back(documentFullName);
3897 for (
int i = 0; i < document->GetContextVariables().size(); i++)
3899 std::shared_ptr<IContextVariable> contextVariable = document->GetContextVariables().at(i);
3901 if (contextVariable ==
nullptr)
3903 REFAPP_END_METHOD();
3907 bool bValueWasSet =
false;
3910 for (
int iRow = 0; iRow < gridViewContext->Rows->Count; iRow++)
3912 System::Windows::Forms::DataGridViewRow^ row = gridViewContext->Rows[iRow];
3914 if (row->Cells[dataGridViewTextBoxColumnContextName->Name]->Value !=
nullptr &&
3915 row->Cells[dataGridViewTextBoxColumnContextName->Name]->Value->Equals(withPrefix ?
3916 Util::Util::ToString(document->GetPackage()->GetFullName() +
"." + document->GetName() +
"." + contextVariable->GetName()) :
3917 Util::Util::ToString(contextVariable->GetName())))
3919 if (radioButtonDefaultImplementation->Checked)
3921 std::shared_ptr<DataTypes::Object> contextVariableValue = piml->ContextVariableImplementation->GetValue(
nullptr, contextVariable,
nullptr);
3922 row->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value = IS_NOT_NULL(contextVariableValue) ?
3923 ConvertValue2String(contextVariableValue) :
3928 row->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value = IS_NOT_NULL(contextVariable->GetInitValue()) ?
3929 ConvertValue2String(contextVariable->GetInitValue()) :
3933 bValueWasSet =
true;
3941 cli::array<System::String^>^ values =
nullptr;
3942 values =
gcnew cli::array<System::String^>{
3943 withPrefix ? Util::Util::ToString(document->GetPackage()->GetFullName() +
"." + document->GetName() +
"." + contextVariable->GetName()) :
3944 Util::Util::ToString(contextVariable->GetName()),
3945 Util::Util::ToString(contextVariable->GetDataType())
3947 int index = gridViewContext->Rows->Add(values);
3949 std::shared_ptr<DataTypes::Object> contextVariableValue = contextVariable->GetInitValue();
3951 gridViewContext->Rows[index]->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IContextVariable>>(contextVariable);
3952 gridViewContext->Rows[index]->ReadOnly = contextVariable->GetInitValue() ==
nullptr;
3953 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::DataTypes::Object>>(contextVariable->GetInitValue());
3954 if (contextVariable->GetDataType()._Equal(
"Boolean"))
3956 System::Windows::Forms::DataGridViewCheckBoxCell^ cell =
gcnew System::Windows::Forms::DataGridViewCheckBoxCell();
3957 cell->Value = ConvertValue2String(contextVariableValue);
3958 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name] = cell;
3959 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(contextVariableValue);
3960 cell->Style->NullValue =
false;
3961 cell->TrueValue =
true;
3962 cell->FalseValue =
false;
3964 else if (std::shared_ptr<DataTypes::EnumerationElement> enumerationElement = std::dynamic_pointer_cast<DataTypes::EnumerationElement>(contextVariableValue))
3966 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name] =
gcnew System::Windows::Forms::DataGridViewComboBoxCell();
3967 System::Windows::Forms::DataGridViewComboBoxCell^ cell =
dynamic_cast<System::Windows::Forms::DataGridViewComboBoxCell^
>(gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]);
3968 cell->DisplayStyle = System::Windows::Forms::DataGridViewComboBoxDisplayStyle::ComboBox;
3969 cell->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
3970 cell->DisplayMember =
"Name";
3971 cell->ValueMember =
"Name";
3972 cell->DataSource = Util::Util::ArrayEnumerationElements2String(enumerationElement->GetEnumeration()->GetElements());;
3973 cell->Value = ConvertValue2String(contextVariableValue);
3974 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(contextVariableValue);
3980 if (IS_NOT_NULL(contextVariableValue))
3982 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value = ConvertValue2String(contextVariableValue);
3986 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value =
nullptr;
3989 catch (System::Exception^ ex)
3991 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]->ErrorText = ex->Message;
3995 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextDetails->Name]->Value = GetDetails(contextVariableValue);
4001 std::vector<std::shared_ptr<IDocument>> importDocs = document->GetImports();
4002 for (
int i = 0; i < importDocs.size(); i++)
4004 UpdateGridViewContextVariable(importDocs[i],
true, listItemReviewed);
4007 catch (System::Exception^ ex)
4011 REFAPP_END_METHOD();
4015 void SampleForm::StateVariableValueChanged(std::shared_ptr<IStateVariable> stateVariable, std::shared_ptr<DataTypes::Object> value)
4017 REFAPP_START_METHOD();
4018 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
4019 arr[0] =
gcnew CLRWrapper<std::shared_ptr<IStateVariable>>(stateVariable);
4020 arr[1] =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(value);
4024 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::StateVariableValueChangedCallback),
gcnew cli::array<System::Object^>{arr});
4028 StateVariableValueChangedCallback(arr);
4030 REFAPP_END_METHOD();
4034 void SampleForm::StateVariableValueChangedCallback(cli::array<System::Object^>^ arr)
4036 REFAPP_START_METHOD();
4037 if (arr ==
nullptr || arr->Length != 2)
4039 REFAPP_END_METHOD();
4043 std::shared_ptr<IStateVariable> stateVariable = Util::Util::CastTo<std::shared_ptr<IStateVariable>>(arr[0]);
4044 std::shared_ptr<DataTypes::Object> value = Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(arr[1]);
4046 if (stateVariable ==
nullptr || value ==
nullptr)
4048 REFAPP_END_METHOD();
4052 System::String^ mappingStr = System::String::Format(
"[MappedTo: {0}{1}",
4053 Util::Util::ToString(stateVariable->GetMappingName()),
4054 stateVariable->GetMappingIndex() > -1 ? (
"[" + stateVariable->GetMappingIndex() +
"]") : System::String::Empty);
4055 System::String^ strValue =
"null";
4058 strValue = Util::Util::ToString(ValueConverter::Value2String(value));
4064 System::String^ outputLog = System::String::Format(
"StateVariableChanged({0} {1}.{2}{3} = {4})",
4065 Util::Util::ToString(stateVariable->GetDataType()),
4066 Util::Util::ToString(stateVariable->GetDocument()->GetFullName()),
4067 Util::Util::ToString(stateVariable->GetName()),
4070 PrintTextCallback(outputLog);
4071 UpdateGridViewStateVariable(stateVariable);
4072 REFAPP_END_METHOD();
4075 void SampleForm::ContextVariableRead(std::shared_ptr<IContextVariable> contextVariable, std::shared_ptr<DataTypes::Object> value)
4077 REFAPP_START_METHOD();
4078 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
4079 arr[0] =
gcnew CLRWrapper<std::shared_ptr<IContextVariable>>(contextVariable);
4080 arr[1] =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(value);
4084 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::ContextVariableReadCallback),
gcnew cli::array<System::Object^>{arr});
4088 ContextVariableReadCallback(arr);
4090 REFAPP_END_METHOD();
4093 void SampleForm::ContextVariableReadCallback(cli::array<System::Object^>^ arr)
4095 REFAPP_START_METHOD();
4096 if (arr ==
nullptr || arr->Length != 2)
4098 REFAPP_END_METHOD();
4102 std::shared_ptr<IContextVariable> contextVariable = Util::Util::CastTo<std::shared_ptr<IContextVariable>>(arr[0]);
4103 std::shared_ptr<DataTypes::Object> value = Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(arr[1]);
4105 if (contextVariable ==
nullptr || value ==
nullptr)
4107 REFAPP_END_METHOD();
4111 System::String^ mappingStr = System::String::Format(
"[MappedTo: {0}{1}",
4112 Util::Util::ToString(contextVariable->GetMappingName()),
4113 (contextVariable->GetMappingIndex() > -1 ? (
"[" + contextVariable->GetMappingIndex() +
"]") : System::String::Empty));
4114 System::String^ strValue =
"null";
4117 strValue = Util::Util::ToString(ValueConverter::Value2String(value));
4122 System::String^ outputLog = System::String::Format(
"ContextVariableRead({0} {1}.{2}{3} = {4})",
4123 Util::Util::ToString(contextVariable->GetDataType()),
4124 Util::Util::ToString(contextVariable->GetDocument()->GetFullName()),
4125 Util::Util::ToString(contextVariable->GetName()),
4129 PrintTextCallback(outputLog);
4130 REFAPP_END_METHOD();
4133 void SampleForm::UpdateGridViewStateVariable(std::shared_ptr<IDocument> document,
bool withPrefix, std::vector<std::string>& listItemReviewed)
4135 REFAPP_START_METHOD();
4136 std::string documentFullName = document->GetPackage()->GetName() +
"." + document->GetName();
4137 if (std::find(listItemReviewed.begin(), listItemReviewed.end(), documentFullName) != listItemReviewed.end())
4139 REFAPP_END_METHOD();
4143 listItemReviewed.push_back(documentFullName);
4144 std::vector<std::shared_ptr<IStateVariable>> stateVariables = document->GetStateVariables();
4145 for (
int i = 0; i < stateVariables.size(); i++)
4147 std::shared_ptr<IStateVariable> stateVariable = stateVariables[i];
4148 cli::array<System::String^>^ values =
nullptr;
4149 values =
gcnew cli::array<System::String^>{
4150 withPrefix ? Util::Util::ToString(document->GetPackage()->GetFullName() +
"." + document->GetName() +
"." + stateVariable->GetName()) :
4151 Util::Util::ToString(stateVariable->GetName()),
4152 Util::Util::ToString(stateVariable->GetDataType())
4154 int index = gridViewState->Rows->Add(values);
4156 gridViewState->Rows[index]->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IStateVariable>>(stateVariable);
4158 if (stateVariable->GetDataType()._Equal(
"Boolean"))
4160 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name] =
gcnew System::Windows::Forms::DataGridViewCheckBoxCell();
4161 System::Windows::Forms::DataGridViewCheckBoxCell^ cell =
dynamic_cast<System::Windows::Forms::DataGridViewCheckBoxCell^
>(gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name]);
4162 cell->Value = ConvertValue2String(stateVariable->GetInitValue());
4163 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(stateVariable->GetInitValue());
4164 cell->Style->NullValue =
false;
4165 cell->TrueValue =
true;
4166 cell->FalseValue =
false;
4168 else if (std::shared_ptr<DataTypes::EnumerationElement> enumerationElement = std::dynamic_pointer_cast<DataTypes::EnumerationElement>(stateVariable->GetInitValue()))
4170 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name] =
gcnew System::Windows::Forms::DataGridViewComboBoxCell();
4171 System::Windows::Forms::DataGridViewComboBoxCell^ cell =
dynamic_cast<System::Windows::Forms::DataGridViewComboBoxCell^
>(gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name]);
4172 cell->DisplayStyle = System::Windows::Forms::DataGridViewComboBoxDisplayStyle::ComboBox;
4173 cell->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
4174 cell->DisplayMember =
"Name";
4175 cell->ValueMember =
"Name";
4176 cell->DataSource = Util::Util::ArrayEnumerationElements2String(enumerationElement->GetEnumeration()->GetElements());;
4177 cell->Value = ConvertValue2String(stateVariable->GetInitValue());
4178 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(stateVariable->GetInitValue());
4184 if (IS_NOT_NULL(stateVariable->GetInitValue()))
4186 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name]->Value = ConvertValue2String(stateVariable->GetInitValue());
4189 catch (System::Exception^ ex)
4191 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name]->ErrorText = ex->Message;
4195 if (IS_NOT_NULL(stateVariable->GetInitValue()))
4197 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateDetails->Name]->Value = GetDetails(stateVariable->GetInitValue());
4203 std::vector<std::shared_ptr<IDocument>> importDocs = document->GetImports();
4204 for (
int i = 0; i < importDocs.size(); i++)
4206 UpdateGridViewStateVariable(importDocs[i],
true, listItemReviewed);
4209 catch (
const std::exception& ex)
4213 catch (System::Exception^ ex)
4217 REFAPP_END_METHOD();
4221 void SampleForm::UpdateGridViewStateVariable(std::shared_ptr<IStateVariable> stateVariable)
4223 REFAPP_START_METHOD();
4224 if (stateVariable ==
nullptr)
4226 REFAPP_END_METHOD();
4231 for (
int i = 0; i < gridViewState->Rows->Count; i++)
4233 System::Windows::Forms::DataGridViewRow^ row = gridViewState->Rows[i];
4234 if (row->Cells[dataGridViewTextBoxColumnStateName->Name]->Value !=
nullptr && Util::Util::CastTo<std::shared_ptr<IStateVariable>>(row->Tag) == stateVariable)
4236 std::shared_ptr<DataTypes::Object> stateVariableValue =
nullptr;
4238 if (radioButtonDefaultImplementation->Checked)
4240 stateVariableValue = piml->StateVariableImplementation->GetValue(stateVariable);
4244 stateVariableValue = stateVariable->GetInitValue();
4247 if (IS_NOT_NULL(stateVariableValue))
4251 row->Cells[dataGridViewTextBoxColumnStateValue->Name]->Value = ConvertValue2String(stateVariableValue);
4253 catch (System::Exception^ ex)
4255 row->Cells[dataGridViewTextBoxColumnStateValue->Name]->ErrorText = ex->Message;
4258 row->Cells[dataGridViewTextBoxColumnStateDetails->Name]->Value = GetDetails(stateVariableValue);
4262 row->Cells[dataGridViewTextBoxColumnStateValue->Name]->Value =
nullptr;
4263 row->Cells[dataGridViewTextBoxColumnStateDetails->Name]->Value = System::String::Empty;
4269 System::Windows::Forms::Application::DoEvents();
4270 REFAPP_END_METHOD();
4273 System::Void SampleForm::buttonNewInstance_Click(System::Object^ sender, System::EventArgs^ e)
4275 REFAPP_START_METHOD();
4276 SampleForm^ form =
gcnew SampleForm();
4277 form->SetInstanceName(Util::Util::ToString(SampleConstants::CHILD_INSTANCE_NAME));
4278 form->SetCreatorForm(
this);
4280 REFAPP_END_METHOD();
4283 System::Void SampleForm::buttonNewInstanceNewThread_Click(System::Object^ sender, System::EventArgs^ e)
4285 REFAPP_START_METHOD();
4286 System::Threading::Thread^ thread =
gcnew System::Threading::Thread(
gcnew System::Threading::ThreadStart(
this, &SampleForm::NewInstanceInThread));
4287 thread->SetApartmentState(System::Threading::ApartmentState::STA);
4289 REFAPP_END_METHOD();
4292 System::Void SampleForm::NewInstanceInThread()
4294 REFAPP_START_METHOD();
4295 SampleForm^ form =
gcnew SampleForm();
4296 form->SetInstanceName(Util::Util::ToString(SampleConstants::CHILD_INSTANCE_NAME));
4297 form->SetCreatorForm(
this);
4298 System::Windows::Forms::Application::Run(form);
4299 REFAPP_END_METHOD();
4302 System::Void SampleForm::buttonHmi_Click(System::Object^ sender, System::EventArgs^ e)
4304 REFAPP_START_METHOD();
4305 if (buttonHmi->Checked)
4307 piml->HmiWindow =
gcnew HmiWindow();
4308 piml->HmiWindow->FormClosing +=
gcnew System::Windows::Forms::FormClosingEventHandler(
this, &SampleForm::HmiWindow_FormClosing);
4309 piml->HmiWindow->SizeChanged +=
gcnew System::EventHandler(
this, &SampleForm::HmiWindow_SizeChanged);
4310 piml->HmiWindow->Activated +=
gcnew System::EventHandler(
this, &SampleForm::HmiWindow_Activated);
4311 piml->HmiWindow->Show();
4313 piml->HmiWindow->Size = System::Drawing::Size(Setting::UserSettings::GetInstance().GetHmiWindowWidth(), Setting::UserSettings::GetInstance().GetHmiWindowHeight());
4314 piml->HmiWindow->Location = System::Drawing::Point(Location.X + Size.Width, Location.Y);
4315 if (IS_NOT_NULL(piml->CreatorForm) && IS_NOT_NULL(piml->CreatorForm->piml->HmiWindow))
4317 piml->HmiWindow->Size = piml->CreatorForm->piml->HmiWindow->Size;
4320 piml->HmiWindow->BringToFront();
4322 piml->CustomScreenImplementation->SetHmiScreenHandle(piml->HmiWindow->GetHmiControl()->Handle.ToInt64());
4324 else if (IS_NOT_NULL(piml->HmiWindow))
4326 piml->HmiWindow->Close();
4329 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonHmi :
nullptr, buttonHmi);
4330 REFAPP_END_METHOD();
4333 System::Void SampleForm::HmiWindow_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e)
4335 REFAPP_START_METHOD();
4336 piml->CustomScreenImplementation->SetHmiScreenHandle(NULL);
4337 piml->HmiWindow =
nullptr;
4339 buttonHmi->Checked =
false;
4340 REFAPP_END_METHOD();
4343 void SampleForm::HmiWindow_Activated(System::Object^ sender, System::EventArgs^ e)
4345 REFAPP_START_METHOD();
4346 if (piml->CustomScreenImplementation !=
nullptr)
4348 piml->CustomScreenImplementation->ActivateHmiScreen();
4350 REFAPP_END_METHOD();
4353 void SampleForm::HmiWindow_SizeChanged(System::Object^ sender, System::EventArgs^ e)
4355 REFAPP_START_METHOD();
4356 Setting::UserSettings::GetInstance().SetHmiWindowWidth(piml->HmiWindow->Width);
4357 Setting::UserSettings::GetInstance().SetHmiWindowHeight(piml->HmiWindow->Height);
4359 if (piml->CustomScreenImplementation !=
nullptr)
4361 piml->CustomScreenImplementation->RefreshHmiScreen();
4363 REFAPP_END_METHOD();
4366 void SampleForm::CustomScreenImplementation_KeyDown(std::shared_ptr<Custom::KeyEventArgs> eventArgs)
4368 REFAPP_START_METHOD();
4369 std::string key =
"Unknown";
4370 if (std::shared_ptr<Custom::WpfKeyEventArgs> wpfKeyEventArgs = std::dynamic_pointer_cast<Custom::WpfKeyEventArgs>(eventArgs))
4372 key = wpfKeyEventArgs->ToString();
4373 if (wpfKeyEventArgs->GetModifierKeys() == Custom::ModifierKeys::Alt &&
4374 wpfKeyEventArgs->GetKey() == Custom::Key::F4)
4376 if (IS_NOT_NULL(piml->HmiWindow))
4378 piml->HmiWindow->Close();
4381 else if (wpfKeyEventArgs->GetKey() == Custom::Key::F10 ||
4382 wpfKeyEventArgs->GetKey() == Custom::Key::LeftAlt ||
4383 wpfKeyEventArgs->GetKey() == Custom::Key::RightAlt)
4385 eventArgs->SetHandled(
true);
4388 else if (std::shared_ptr<Custom::FormKeyEventArgs> formKeyEventArgs = std::dynamic_pointer_cast<Custom::FormKeyEventArgs>(eventArgs))
4390 if (formKeyEventArgs->GetModifierKeys() == Custom::Keys::Alt &&
4391 formKeyEventArgs->GetKey() == Custom::Keys::F4)
4393 if (IS_NOT_NULL(piml->HmiWindow))
4395 piml->HmiWindow->Close();
4398 else if (formKeyEventArgs->GetKey() == Custom::Keys::F10 ||
4399 formKeyEventArgs->GetKey() == Custom::Keys::Alt)
4401 eventArgs->SetHandled(
true);
4403 key = formKeyEventArgs->ToString();
4406 PrintTextCallback(
"CustomScreenImplementation_KeyDown(" + Util::Util::ToString(key) +
")");
4407 REFAPP_END_METHOD();
4410 System::Void SampleForm::SampleForm_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e)
4412 REFAPP_START_METHOD();
4414 for (
size_t i = 0; i < piml->ListForms.size(); i++)
4416 if (piml->ListForms.at(i).get() ==
this)
4424 if (piml->GlobalRuntimeManager !=
nullptr)
4426 piml->GlobalRuntimeManager->StopAll();
4427 piml->RemoveRuntimeEvents(piml->GlobalRuntimeManager);
4432 piml->RemoveOutputImplLogEventHandler();
4435 REFAPP_END_METHOD();
4438 void SampleForm::SaveSettings()
4440 REFAPP_START_METHOD();
4443 unsigned long long longValue;
4445 if (piml != NULL && IS_NULL(piml->CreatorForm))
4448 Setting::UserSettings::GetInstance().SetPtxPpxDirectory(Util::Util::ToString(cbFilePath->Text->Trim()));
4449 Setting::UserSettings::GetInstance().SetPtxPpxDirectoryList(Util::Util::Join(
";", cbFilePath->Items->GetEnumerator()));
4451 Setting::UserSettings::GetInstance().SetTraceFileMaxCount(System::Int32::TryParse(textBoxTraceFileMaxCount->Text->Trim(), integerValue) ?
4453 Setting::UserSettings::GetInstance().GetTraceFileMaxCount());
4454 Setting::UserSettings::GetInstance().SetTraceFileMaxSize(System::Int32::TryParse(textBoxTraceFileMaxSize->Text->Trim(), integerValue) ?
4456 Setting::UserSettings::GetInstance().GetTraceFileMaxSize());
4457 Setting::UserSettings::GetInstance().SetProfiling(checkBoxProfiling->Checked);
4458 Setting::UserSettings::GetInstance().SetProfilingMaxFileSize(System::Int32::TryParse(textBoxProfilingSize->Text->Trim(), integerValue) ?
4460 Setting::UserSettings::GetInstance().GetProfilingMaxFileSize());
4461 Setting::UserSettings::GetInstance().SetTraceLevels(RuntimeConfig::GetInstance().GetTraceLevel());
4462 Setting::UserSettings::GetInstance().SetTracingDirectory(Util::Util::ToString(textBoxTraceFolder->Text->Trim()));
4464 Setting::UserSettings::GetInstance().SetWindowWidth(Size.Height);
4465 Setting::UserSettings::GetInstance().SetWindowWidth(Size.Width);
4466 Setting::UserSettings::GetInstance().SetWindowLocationX(Location.X);
4467 Setting::UserSettings::GetInstance().SetWindowLocationY(Location.Y);
4468 Setting::UserSettings::GetInstance().SetCustomImplTypes(GetCurrentCustomImpl());
4469 SaveSocketPortOrPipeName();
4471 Setting::UserSettings::GetInstance().SetAsynchron(checkBoxAsyncExecution->Checked);
4472 Setting::UserSettings::GetInstance().SetCyclic(checkBoxCyclicExecution->Checked);
4473 Setting::UserSettings::GetInstance().SetCyclicReload(checkBoxCyclicReload->Checked);
4474 Setting::UserSettings::GetInstance().SetNewRuntimeManager(checkBoxNewRuntimeManager->Checked);
4475 Setting::UserSettings::GetInstance().SetAddMessageToOutput(checkBoxAdd2Output->Checked);
4476 Setting::UserSettings::GetInstance().SetStartAllParents(checkBoxStartAllParents->Checked);
4478 Setting::UserSettings::GetInstance().SetTimeout(System::UInt64::TryParse(textBoxTimeout->Text->Trim(), longValue) ?
4480 Setting::UserSettings::GetInstance().GetTimeOut());
4481 Setting::UserSettings::GetInstance().SetConnectionState(checkBoxUseConnectionState->Checked);
4482 Setting::UserSettings::GetInstance().SetIgnition((
int)checkBoxIgnition->CheckState);
4483 Setting::UserSettings::GetInstance().SetPollingTime(System::Int32::TryParse(textBoxPollingTime->Text->Trim(), integerValue) ?
4485 Setting::UserSettings::GetInstance().GetPollingTime());
4486 Setting::UserSettings::GetInstance().SetVoltageThreshold(System::Int32::TryParse(textBoxVoltageThreshold->Text->Trim(), integerValue) ?
4488 Setting::UserSettings::GetInstance().GetVoltageThreshold());
4490 Setting::UserSettings::GetInstance().SetRuntimeContextName(Util::Util::ToString(textBoxRuntimeContextName->Text->Trim()));
4492 #pragma region C++ for RAW-mode
4493 Setting::UserSettings::GetInstance().SetDiagIpcType(comboBoxDiagIpcType->SelectedItem !=
nullptr ?
4494 Util::Util::ToIpcType(comboBoxDiagIpcType->SelectedItem->ToString()) :
4496 Setting::UserSettings::GetInstance().SetDiagManagerLicenseKey(Util::LicenseUtil::Encrypt(Util::Util::ToString(textBoxDiagManagerLicenseKey->Text)));
4497 Setting::UserSettings::GetInstance().SetDiagManagerTraceLevel(comboBoxDiagManagerTraceLevel->SelectedItem !=
nullptr ?
4498 Util::Util::ToLoggerLevel(comboBoxDiagManagerTraceLevel->SelectedItem->ToString()) :
4500 Setting::UserSettings::GetInstance().SetDiagLoggingTraceLevel(comboBoxDiagLoggingTraceLevel->SelectedItem !=
nullptr ?
4501 Util::Util::ToDiagDiagnosticsLogLevel(comboBoxDiagLoggingTraceLevel->SelectedItem->ToString()) :
4503 Setting::UserSettings::GetInstance().SetIncludeTraceDiagLogging(checkBoxIncludedDiagLogging->Checked);
4504 Setting::UserSettings::GetInstance().SetDiagTraceDirectory(Util::Util::ToString(textBoxDiagManagerTraceFolder->Text));
4505 Setting::UserSettings::GetInstance().SetOdxProject(comboBoxODXProject->SelectedItem !=
nullptr ?
4506 Util::Util::ToString(comboBoxODXProject->SelectedItem->ToString()) :
4508 Setting::UserSettings::GetInstance().SetOdxVehicleInformation(comboBoxODXVehicle->SelectedItem !=
nullptr ?
4509 Util::Util::ToString(comboBoxODXVehicle->SelectedItem->ToString()) :
4513 Setting::UserSettings::GetInstance().Save();
4515 REFAPP_END_METHOD();
4518 void SampleForm::SaveSocketPortOrPipeName()
4520 REFAPP_START_METHOD();
4521 IpcTypes ipcType = Util::Util::ToIpcType(comboBoxIpcType->SelectedItem->ToString());
4522 unsigned short unsignedShortValue;
4526 #pragma region C++ for RAW-mode
4529 Setting::UserSettings::GetInstance().SetIpcType(ipcType);
4533 case IpcTypes::Socket:
4537 Setting::UserSettings::GetInstance().SetDiagManagerPort(System::UInt16::TryParse(textBoxDiagPortPipe->Text->Trim(), unsignedShortValue) ?
4538 unsignedShortValue :
4539 SampleConstants::DEFAULT_DM_PORT);
4540 Setting::UserSettings::GetInstance().SetRuntimePort(System::UInt16::TryParse(textBoxRtPortPipe->Text->Trim(), unsignedShortValue) ?
4541 unsignedShortValue :
4542 SampleConstants::DEFAULT_RT_PORT);
4543 Setting::UserSettings::GetInstance().SetIpcType(ipcType);
4547 Setting::UserSettings::GetInstance().SetDiagManagerPort(SampleConstants::DEFAULT_DM_PORT);
4548 Setting::UserSettings::GetInstance().SetRuntimePort(SampleConstants::DEFAULT_RT_PORT);
4552 case IpcTypes::Pipe:
4554 std::string diagManagerPipeName = Util::Util::ToString(textBoxDiagPortPipe->Text->Trim());
4555 std::string runtimePipeName = Util::Util::ToString(textBoxRtPortPipe->Text->Trim());
4557 Setting::UserSettings::GetInstance().SetDiagManagerPipeName(!diagManagerPipeName.empty() ? diagManagerPipeName : SampleConstants::DEFAULT_DM_PIPE_NAME);
4558 Setting::UserSettings::GetInstance().SetRuntimePipeName(!runtimePipeName.empty() ? runtimePipeName : SampleConstants::DEFAULT_RT_PIPE_NAME);
4559 Setting::UserSettings::GetInstance().SetIpcType(ipcType);
4565 REFAPP_END_METHOD();
4568 System::Void SampleForm::textBoxRuntimeContextName_TextChanged(System::Object^ sender, System::EventArgs^ e)
4570 REFAPP_START_METHOD();
4571 textBoxRuntimeContextName->Text = textBoxRuntimeContextName->Text->Trim();
4572 piml->RuntimeContextName = Util::Util::ToString(textBoxRuntimeContextName->Text);
4574 SetTitle(Util::Util::ToString(piml->Title));
4575 REFAPP_END_METHOD();
4578 System::Void SampleForm::listBoxOuput_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e)
4580 REFAPP_START_METHOD();
4581 buttonCopyRow->Enabled = listBoxOuput->SelectedItems->Count > 0;
4582 REFAPP_END_METHOD();
4585 System::Void SampleForm::buttonPause_Click(System::Object^ sender, System::EventArgs^ e)
4587 REFAPP_START_METHOD();
4588 msclr::lock l(piml->LockRuntimeContexts.get());
4590 if (buttonPause->Checked)
4592 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4594 if (piml->RuntimeContexts[i]->GetExecutionState() == ExecutionState::Running)
4596 piml->RuntimeContexts[i]->Pause();
4602 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4604 if (piml->RuntimeContexts[i]->GetExecutionState() == ExecutionState::Paused)
4606 piml->RuntimeContexts[i]->Continue();
4612 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonPause :
nullptr, buttonPause);
4613 REFAPP_END_METHOD();
4616 void SampleForm::AddRuntimeContext(IRuntimeContext* context)
4618 REFAPP_START_METHOD();
4619 msclr::lock l(piml->LockRuntimeContexts.get());
4621 if (std::find(piml->RuntimeContexts.begin(), piml->RuntimeContexts.end(), context) == piml->RuntimeContexts.end())
4623 piml->RuntimeContexts.push_back(context);
4626 if (piml->RuntimeContextIdsExecutionStartTick.find(context->GetRuntimeId()) == piml->RuntimeContextIdsExecutionStartTick.end())
4628 piml->RuntimeContextIdsExecutionStartTick.insert({ context->GetRuntimeId(), System::DateTime::Now.Ticks });
4631 REFAPP_END_METHOD();
4634 void SampleForm::RemoveRuntimeContext(IRuntimeContext* context)
4636 REFAPP_START_METHOD();
4637 long long contextRuntimeId = context->GetRuntimeId();
4639 msclr::lock l(piml->LockRuntimeContexts.get());
4641 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4643 if (piml->RuntimeContexts[i]->GetRuntimeId() == contextRuntimeId)
4645 piml->RuntimeContexts.erase(piml->RuntimeContexts.begin() + i);
4649 std::map<long long, long long>::iterator itr = piml->RuntimeContextIdsExecutionStartTick.find(contextRuntimeId);
4650 if (itr != piml->RuntimeContextIdsExecutionStartTick.end())
4652 piml->RuntimeContextIdsExecutionStartTick.erase(itr);
4655 REFAPP_END_METHOD();
4658 bool SampleForm::IsPauseEnabled()
4660 REFAPP_START_METHOD();
4661 msclr::lock l(piml->LockRuntimeContexts.get());
4663 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4665 if (piml->RuntimeContexts[i]->GetExecutionState() == ExecutionState::Running)
4667 REFAPP_END_METHOD();
4672 REFAPP_END_METHOD();
4677 bool SampleForm::IsContinueEnable()
4679 REFAPP_START_METHOD();
4680 msclr::lock l(piml->LockRuntimeContexts.get());
4682 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4684 if (piml->RuntimeContexts[i]->GetExecutionState() == ExecutionState::Paused)
4686 REFAPP_END_METHOD();
4690 REFAPP_END_METHOD();
4695 void SampleForm::SetExpectedState()
4697 REFAPP_START_METHOD();
4698 if (piml->UseConnectionState)
4700 if (piml->KL15State == -1)
4702 piml->ExpectedConnectionState = ExpectedState::BatteryOn;
4704 else if (piml->KL15State == 1)
4706 piml->ExpectedConnectionState = ExpectedState::IgnitionOn;
4710 piml->ExpectedConnectionState = ExpectedState::IgnitionOff;
4715 piml->ExpectedConnectionState = ExpectedState::None;
4717 REFAPP_END_METHOD();
4720 System::Void SampleForm::checkBoxUseConnectionState_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
4722 REFAPP_START_METHOD();
4723 piml->UseConnectionState = checkBoxUseConnectionState->Checked;
4724 EnableConnectionState();
4727 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
4728 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16")));
4729 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16")));
4731 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxUseConnectionState :
nullptr, checkBoxUseConnectionState);
4732 REFAPP_END_METHOD();
4735 System::Void SampleForm::CheckBoxKL15_CheckStateChanged(System::Object^ sender, System::EventArgs^ e)
4737 REFAPP_START_METHOD();
4738 switch (checkBoxIgnition->CheckState)
4740 case System::Windows::Forms::CheckState::Checked:
4741 piml->KL15State = 1;
4743 case System::Windows::Forms::CheckState::Unchecked:
4744 piml->KL15State = 0;
4747 piml->KL15State = -1;
4753 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxIgnition :
nullptr, checkBoxIgnition);
4754 REFAPP_END_METHOD();
4757 void SampleForm::EnableConnectionState()
4759 labelExpectedState->Enabled = piml->UseConnectionState;
4760 labelBatteryState->Enabled = piml->UseConnectionState;
4761 checkBoxIgnition->Enabled = piml->UseConnectionState;
4762 labelPollingTime->Enabled = piml->UseConnectionState;
4763 textBoxPollingTime->Enabled = piml->UseConnectionState;
4764 labelVoltageThreshold->Enabled = piml->UseConnectionState;
4765 textBoxVoltageThreshold->Enabled = piml->UseConnectionState;
4766 buttonCheckBatteryIgnition->Enabled = piml->UseConnectionState;
4769 System::Void SampleForm::buttonCheckBatteryIgnition_Click(System::Object^ sender, System::EventArgs^ e)
4771 REFAPP_START_METHOD();
4772 CheckBatteryIgnitionState(piml->GlobalRuntimeManager);
4774 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonCheckBatteryIgnition :
nullptr, buttonCheckBatteryIgnition);
4775 REFAPP_END_METHOD();
4778 System::Void SampleForm::textBoxPollingTime_TextChanged(System::Object^ sender, System::EventArgs^ e)
4780 REFAPP_START_METHOD();
4783 if (System::Convert::ToInt32(textBoxPollingTime->Text->Trim()) <= 0)
4785 textBoxPollingTime->Text = piml->DEFAULT_POLLING_TIME.ToString();
4790 textBoxPollingTime->Text = piml->DEFAULT_POLLING_TIME.ToString();
4793 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxPollingTime :
nullptr, textBoxPollingTime);
4794 REFAPP_END_METHOD();
4797 System::Void SampleForm::textBoxBatteryVoltageThreshold_TextChanged(System::Object^ sender, System::EventArgs^ e)
4799 REFAPP_START_METHOD();
4802 if (System::Convert::ToInt32(textBoxVoltageThreshold->Text->Trim()) <= 0)
4804 textBoxVoltageThreshold->Text = piml->DEFAULT_POLLING_TIME.ToString();
4809 textBoxVoltageThreshold->Text = piml->DEFAULT_POLLING_TIME.ToString();
4812 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxVoltageThreshold :
nullptr, textBoxVoltageThreshold);
4813 REFAPP_END_METHOD();
4816 void SampleForm::CheckBatteryIgnitionState(std::shared_ptr<IRuntimeManager> runtimeManager)
4818 REFAPP_START_METHOD();
4819 if (piml->UseConnectionState)
4821 runtimeManager->GetDiagConnectionState()->SetPollingTime(System::Convert::ToInt32(textBoxPollingTime->Text));
4822 runtimeManager->GetDiagConnectionState()->SetBatteryVoltageThreshold(System::Convert::ToInt32(textBoxVoltageThreshold->Text));
4823 ClampState batteryState = runtimeManager->GetDiagConnectionState()->GetBatteryState();
4824 ClampState ignitionState = runtimeManager->GetDiagConnectionState()->GetIgnitionState();
4826 SetBatteryIgnitionState(batteryState, ignitionState);
4828 PrintTextCallback(
"Check DiagConnection State - BatteryState = " + Util::Util::ToString(batteryState) +
", IgnitionState = " + Util::Util::ToString(ignitionState));
4830 REFAPP_END_METHOD();
4833 void SampleForm::SetBatteryIgnitionState(ClampState batteryState, ClampState ignitionState)
4835 REFAPP_START_METHOD();
4836 #pragma region C++ for initialize resource
4837 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
4840 switch (batteryState)
4843 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBatteryNotAvailable16")));
4845 case OpenTestSystem::Otx::Runtime::Api::ClampState::Off:
4846 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBatteryOff16")));
4849 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBatteryOn16")));
4853 switch (ignitionState)
4856 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnitionNotAvailable16")));
4858 case OpenTestSystem::Otx::Runtime::Api::ClampState::Off:
4859 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnitionOff16")));
4862 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnitionOn16")));
4865 REFAPP_END_METHOD();
4868 void SampleForm::ShowConnectionStateMessage(IRuntimeContext* runtimeContext)
4870 REFAPP_START_METHOD();
4871 if (runtimeContext !=
nullptr)
4873 System::Media::SystemSounds::Beep->Play();
4875 switch (piml->ExpectedConnectionState)
4878 PrintTextCallback(
"----------------------------------------------------------------------------------------------------------------------------------------------");
4879 PrintTextCallback(
"-- Not expected connection state: Either it is not possible to communicate with the VCI or the battery is not connected. Please connect it! --");
4880 PrintTextCallback(
"----------------------------------------------------------------------------------------------------------------------------------------------");
4883 PrintTextCallback(
"------------------------------------------------------------------------------------");
4884 PrintTextCallback(
"-- Not expected connection state: The ignition must be OFF. Please switch it OFF! --");
4885 PrintTextCallback(
"------------------------------------------------------------------------------------");
4888 PrintTextCallback(
"----------------------------------------------------------------------------------");
4889 PrintTextCallback(
"-- Not expected connection state: The ignition must be ON. Please switch it ON! --");
4890 PrintTextCallback(
"----------------------------------------------------------------------------------");
4896 REFAPP_END_METHOD();
4899 System::Void SampleForm::checkBoxAdd2Output_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
4901 REFAPP_START_METHOD();
4902 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxAdd2Output :
nullptr, checkBoxAdd2Output);
4903 REFAPP_END_METHOD();
4906 void SampleForm::NumericUpDownSetValueCallback(cli::array<System::Object^>^ arr)
4908 REFAPP_START_METHOD();
4909 if (arr ==
nullptr || arr->Length != 2)
4911 REFAPP_END_METHOD();
4915 System::Windows::Forms::NumericUpDown^ numericUpDown =
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(arr[0]);
4916 System::Windows::Forms::NumericUpDown^ control =
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(arr[1]);
4918 numericUpDown->Value = control->Value;
4919 REFAPP_END_METHOD();
4922 void SampleForm::ParentNumericUpDownSetValueCallback(System::Object^ state)
4924 REFAPP_START_METHOD();
4925 cli::array<System::Object^>^ arr =
dynamic_cast<cli::array<System::Object^>^
>(state);
4926 if (arr ==
nullptr || arr->Length != 2) {
4927 REFAPP_END_METHOD();
4931 System::Windows::Forms::NumericUpDown^ numericUpDown =
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(arr[0]);
4932 System::Windows::Forms::NumericUpDown^ control =
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(arr[1]);
4934 if (numericUpDown ==
nullptr || control ==
nullptr)
4936 REFAPP_END_METHOD();
4940 if (numericUpDown->InvokeRequired)
4942 piml->CreatorForm->Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::NumericUpDownSetValueCallback),
gcnew cli::array<System::Object^>{arr});
4946 NumericUpDownSetValueCallback(arr);
4948 REFAPP_END_METHOD();
4951 System::Void SampleForm::comboBoxTraceLevel_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e)
4953 REFAPP_START_METHOD();
4954 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->comboBoxTraceLevel :
nullptr,
4955 comboBoxTraceLevel);
4956 REFAPP_END_METHOD();
4959 System::Void SampleForm::txtPassword_TextChanged(System::Object^ sender, System::EventArgs^ e)
4961 REFAPP_START_METHOD();
4962 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->txtPassword :
nullptr, txtPassword);
4963 REFAPP_END_METHOD();
4966 System::Void SampleForm::textBoxTimeout_TextChanged(System::Object^ sender, System::EventArgs^ e)
4968 REFAPP_START_METHOD();
4969 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxTimeout :
nullptr, textBoxTimeout);
4970 REFAPP_END_METHOD();
4973 System::Void SampleForm::checkBoxProfiling_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
4975 REFAPP_START_METHOD();
4976 if (piml->GlobalRuntimeManager ==
nullptr)
4978 REFAPP_END_METHOD();
4982 PrintTextCallback(
"Set Profiling to " + checkBoxProfiling->Checked.ToString());
4986 RuntimeConfig::GetInstance().SetProfiling(checkBoxProfiling->Checked);
4987 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxProfiling :
nullptr);
4989 catch (System::Exception^ ex)
4992 checkBoxProfiling->Checked = RuntimeConfig::GetInstance().GetProfiling();
4994 REFAPP_END_METHOD();
4997 System::Void SampleForm::textBoxTraceFileMaxSize_TextChanged(System::Object^ sender, System::EventArgs^ e)
4999 REFAPP_START_METHOD();
5000 if (piml->GlobalRuntimeManager ==
nullptr)
5002 REFAPP_END_METHOD();
5006 PrintTextCallback(
"Set TraceFileMaxSize to " + textBoxTraceFileMaxSize->Text);
5010 RuntimeConfig::GetInstance().SetTraceFileMaxSize(System::Convert::ToInt32(textBoxTraceFileMaxSize->Text));
5011 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxTraceFileMaxSize :
nullptr, textBoxTraceFileMaxSize);
5013 catch (System::Exception^ ex)
5016 textBoxTraceFileMaxSize->Text = RuntimeConfig::GetInstance().GetTraceFileMaxSize().ToString();
5018 REFAPP_END_METHOD();
5021 System::Void SampleForm::textBoxProfilingSize_TextChanged(System::Object^ sender, System::EventArgs^ e)
5023 REFAPP_START_METHOD();
5024 if (piml->GlobalRuntimeManager ==
nullptr)
5026 REFAPP_END_METHOD();
5030 PrintTextCallback(
"Set ProfilingFileMaxSize to " + textBoxProfilingSize->Text->Trim());
5034 RuntimeConfig::GetInstance().SetProfilingMaxFileSize(System::Convert::ToUInt32(textBoxProfilingSize->Text));
5035 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxProfilingSize :
nullptr, textBoxProfilingSize);
5038 catch (System::Exception^ ex)
5041 textBoxProfilingSize->Text = RuntimeConfig::GetInstance().GetProfilingMaxFileSize().ToString();
5045 System::Void SampleForm::textBoxTraceFileMaxCount_TextChanged(System::Object^ sender, System::EventArgs^ e)
5047 REFAPP_START_METHOD();
5048 if (piml->GlobalRuntimeManager ==
nullptr)
5050 REFAPP_END_METHOD();
5054 PrintTextCallback(
"Set TraceFileMaxCount to " + textBoxTraceFileMaxCount->Text);
5058 RuntimeConfig::GetInstance().SetTraceFileMaxCount(System::Convert::ToInt32(textBoxTraceFileMaxCount->Text));
5059 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxTraceFileMaxCount :
nullptr,
5060 textBoxTraceFileMaxCount);
5062 catch (System::Exception^ ex)
5065 textBoxTraceFileMaxCount->Text = RuntimeConfig::GetInstance().GetTraceFileMaxCount().ToString();
5067 REFAPP_END_METHOD();
5070 void SampleForm::WebServerTimer_Tick(System::Object^ sender, System::EventArgs^ e)
5072 REFAPP_START_METHOD();
5073 UpdateWebServerButtonCallback();
5074 REFAPP_END_METHOD();
5077 void SampleForm::UpdateWebServerButtonCallback()
5079 REFAPP_START_METHOD();
5082 Invoke(
gcnew System::Action(
this, &SampleForm::UpdateWebServerButtonCallback));
5083 REFAPP_END_METHOD();
5086 if (piml->CustomScreenImplementation ==
nullptr)
5088 buttonStartStopWebServer->Enabled =
false;
5089 REFAPP_END_METHOD();
5093 buttonStartStopWebServer->Enabled =
true;
5094 #pragma region C++ for initialize resource
5095 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
5097 if (Custom::DefaultCustomScreenImplementation::IsStartedHtmlWebserver())
5099 if (piml->IsStartWebSever == 1 || resources ==
nullptr)
5101 REFAPP_END_METHOD();
5105 if (Util::Util::IsInstance<System::Object^>(resources->GetObject(L
"StopWebServer.image")))
5107 buttonStartStopWebServer->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"StopWebServer.image")));
5108 piml->IsStartWebSever = 1;
5113 if (piml->IsStartWebSever == 0 || resources ==
nullptr)
5115 REFAPP_END_METHOD();
5119 if (Util::Util::IsInstance<System::Object^>(resources->GetObject(L
"StartWebServer.image")))
5121 buttonStartStopWebServer->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"StartWebServer.image")));
5122 piml->IsStartWebSever = 0;
5125 REFAPP_END_METHOD();
5128 System::Void SampleForm::buttonStartStopWebServer_Click(System::Object^ sender, System::EventArgs^ e)
5130 StartStopWebServerCallback();
5133 void SampleForm::StartStopWebServerCallback()
5135 REFAPP_START_METHOD();
5138 Invoke(
gcnew System::Action(
this, &SampleForm::StartStopWebServerCallback));
5139 REFAPP_END_METHOD();
5143 if (piml->CustomScreenImplementation ==
nullptr)
5145 REFAPP_END_METHOD();
5149 if (Custom::DefaultCustomScreenImplementation::IsStartedHtmlWebserver() ==
false)
5151 piml->CustomScreenImplementation->StartHtmlWebServer();
5155 piml->CustomScreenImplementation->StopHtmlWebServer();
5157 REFAPP_END_METHOD();
5160 System::Void SampleForm::buttonLicense_Click(System::Object^ sender, System::EventArgs^ e)
5162 REFAPP_START_METHOD();
5163 LicenseForm^ form =
gcnew LicenseForm();
5164 form->SetParentForm(
this);
5165 if (form !=
nullptr)
5167 form->ShowDialog(
this);
5169 REFAPP_END_METHOD();
5172 void SampleForm::ReloadRuntimeManager()
5174 REFAPP_START_METHOD();
5184 piml->IpcInitializedBefore =
"Reloading RuntimeManager";
5185 piml->GlobalRuntimeManager = CreateRuntimeManager();
5189 catch (
const std::exception& ex)
5192 PrintTextCallback(
"No RuntimeManager created");
5194 catch (System::Exception^ ex)
5197 PrintTextCallback(
"No RuntimeManager created");
5199 REFAPP_END_METHOD();
5202 #pragma region C++ for Invoke inside DoCyclic
5203 void SampleForm::ReloadContextFileCallback(CLRWrapper<std::shared_ptr<IRuntimeManager>>^ clrRuntimeManager)
5205 REFAPP_START_METHOD();
5207 if (checkBoxNewRuntimeManager->Checked)
5209 LoadContextFile(clrRuntimeManager->GetPtr());
5211 REFAPP_END_METHOD();
5216 IRuntimeContext* SampleForm::GetRuntimeContext(
long long runtimeId)
5218 REFAPP_START_METHOD();
5219 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
5221 if (piml->RuntimeContexts[i]->GetRuntimeId() == runtimeId)
5223 REFAPP_END_METHOD();
5224 return piml->RuntimeContexts[i];
5227 REFAPP_END_METHOD();
5231 void SampleForm::SetInstanceName(System::String^ instanceName)
5233 REFAPP_START_METHOD();
5234 if (System::String::IsNullOrEmpty(instanceName) ==
false)
5236 piml->Title = Util::Util::ToString(instanceName);
5240 piml->Title = SampleConstants::MAIN_INSTANCE_NAME;
5242 REFAPP_END_METHOD();
5245 void SampleForm::SetCreatorForm(SampleForm^ creatorForm)
5247 piml->CreatorForm = creatorForm;
5252 #pragma region C++ for RAW-mode
5253 std::shared_ptr<IRuntimeManager> SampleForm::CreateRawRuntimeManager()
5255 REFAPP_START_METHOD();
5256 std::shared_ptr<IRuntimeManager> runtimeManager =
nullptr;
5257 System::String^ ipcTypeString =
"";
5258 if (comboBoxDiagIpcType->SelectedItem !=
nullptr)
5260 ipcTypeString = comboBoxDiagIpcType->SelectedItem->ToString()->Trim();
5262 IpcTypes ipcType = Util::Util::ToIpcType(ipcTypeString);
5263 std::string licenseKey;
5264 std::shared_ptr<Otx::DiagManager::OtxDiagApi::IOtxDiag> rawOtxDiag =
nullptr;
5265 unsigned short diagPort;
5266 std::string inforRuntimeManagerCurrent;
5270 case OpenTestSystem::Otx::Runtime2::Api::Sample::Raw:
5272 comboBoxODXProject->Items->Clear();
5273 comboBoxODXVehicle->Items->Clear();
5275 licenseKey = Util::Util::ToString(textBoxDiagManagerLicenseKey->Text);
5277 inforRuntimeManagerCurrent =
"ipcRaw-diagIPCRaw with licenseKey=" + licenseKey;
5278 if (piml->IpcInitializedBefore._Equal(inforRuntimeManagerCurrent))
5280 REFAPP_END_METHOD();
5281 return runtimeManager;
5285 piml->IpcInitializedBefore = inforRuntimeManagerCurrent;
5288 rawOtxDiag = Util::OtxDiagUtil::RawOtxDiag(licenseKey);
5289 runtimeManager = RuntimeManagerFactory::CreateRawRuntimeManager(rawOtxDiag);
5291 InitializeODXProject();
5294 case OpenTestSystem::Otx::Runtime2::Api::Sample::Socket:
5296 diagPort = System::Convert::ToUInt16(textBoxDiagPortPipe->Text);
5298 inforRuntimeManagerCurrent =
"ipcRaw-diagIPCSocket with port=" + std::to_string(diagPort);
5299 if (piml->IpcInitializedBefore._Equal(inforRuntimeManagerCurrent))
5301 REFAPP_END_METHOD();
5302 return runtimeManager;
5306 piml->IpcInitializedBefore = inforRuntimeManagerCurrent;
5309 runtimeManager = RuntimeManagerFactory::CreateRawRuntimeManager(diagPort);
5312 case OpenTestSystem::Otx::Runtime2::Api::Sample::Pipe:
5314 inforRuntimeManagerCurrent =
"ipcRaw-diagIPCPipe with pipe=" + Util::Util::ToString(textBoxDiagPortPipe->Text);
5315 if (piml->IpcInitializedBefore._Equal(inforRuntimeManagerCurrent))
5317 REFAPP_END_METHOD();
5318 return runtimeManager;
5322 piml->IpcInitializedBefore = inforRuntimeManagerCurrent;
5326 runtimeManager = RuntimeManagerFactory::CreateRawRuntimeManager(Util::Util::ToString(textBoxDiagPortPipe->Text));
5331 REFAPP_END_METHOD();
5332 return runtimeManager;
5335 System::Void SampleForm::comboBoxODXProject_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
5337 REFAPP_START_METHOD();
5340 System::String^ stringOdxProject = comboBoxODXProject->SelectedItem->ToString();
5341 comboBoxODXVehicle->Items->Clear();
5342 std::shared_ptr<Otx::DiagManager::OtxDiagApi::IOtxDiag> rawOtxDiag = Util::OtxDiagUtil::RawOtxDiag();
5343 if (rawOtxDiag !=
nullptr && rawOtxDiag->GetDiagConfiguration() !=
nullptr && System::String::IsNullOrEmpty(stringOdxProject) ==
false)
5345 std::string odxProject = Util::Util::ToString(comboBoxODXProject->SelectedItem->ToString());
5346 rawOtxDiag->GetDiagConfiguration()->SelectProject(odxProject);
5348 std::vector<std::string> odxVehicles = rawOtxDiag->GetDiagConfiguration()->GetDbVehicleInformationList();
5350 std::string vehicleSetting = Setting::UserSettings::GetInstance().GetOdxVehicleInformation();
5352 for (
size_t i = 0; i < odxVehicles.size(); i++)
5354 std::string odxVehicle = odxVehicles[i];
5355 comboBoxODXVehicle->Items->Add(Util::Util::ToString(odxVehicle));
5357 if (vehicleSetting._Equal(odxVehicle))
5359 comboBoxODXVehicle->SelectedIndex = i;
5363 if (comboBoxODXVehicle->SelectedIndex == -1)
5365 comboBoxODXVehicle->SelectedIndex = 0;
5370 comboBoxODXVehicle->Items->Add(
"");
5371 comboBoxODXVehicle->SelectedIndex = 0;
5374 catch (
const std::exception& ex)
5378 catch (System::Exception^ ex)
5382 REFAPP_END_METHOD();
5385 System::Void SampleForm::comboBoxODXVehicle_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
5387 REFAPP_START_METHOD();
5390 System::String^ stringOdxVehicle = comboBoxODXVehicle->SelectedItem->ToString()->Trim();
5391 std::shared_ptr<Otx::DiagManager::OtxDiagApi::IOtxDiag> rawOtxDiag = Util::OtxDiagUtil::RawOtxDiag();
5392 if (System::String::IsNullOrEmpty(stringOdxVehicle) ==
false && rawOtxDiag !=
nullptr)
5394 rawOtxDiag->GetDiagConfiguration()->SelectVehicleInformation(Util::Util::ToString(stringOdxVehicle));
5397 catch (
const std::exception& ex)
5401 catch (System::Exception^ ex)
5405 REFAPP_END_METHOD();
5408 void SampleForm::InitializeODXProject()
5410 REFAPP_START_METHOD();
5411 comboBoxODXProject->Items->Clear();
5415 std::string licenseKey = Util::Util::ToString(textBoxDiagManagerLicenseKey->Text);
5416 std::shared_ptr<OpenTestSystem::Otx::DiagManager::OtxDiagApi::IOtxDiag> otxDiag = Util::OtxDiagUtil::RawOtxDiag(licenseKey);
5418 if (otxDiag ==
nullptr || otxDiag->GetDiagConfiguration() ==
nullptr)
5420 REFAPP_END_METHOD();
5424 std::vector<std::string> dbProjectList = otxDiag->GetDiagConfiguration()->GetDbProjectList();
5426 std::string odxProjectSetting = Setting::UserSettings::GetInstance().GetOdxProject();
5427 for (
size_t i = 0; i < dbProjectList.size(); i++)
5429 std::string dbProject = dbProjectList[i];
5430 comboBoxODXProject->Items->Add(Util::Util::ToString(dbProject));
5432 if (odxProjectSetting._Equal(dbProject))
5434 comboBoxODXProject->SelectedIndex = i;
5438 if (comboBoxODXProject->SelectedIndex == -1)
5440 comboBoxODXProject->SelectedIndex = 0;
5443 catch (
const std::exception& ex)
5447 catch (System::Exception^ ex)
5451 REFAPP_END_METHOD();
5454 void SampleForm::SetupDiagManagerControls()
5456 REFAPP_START_METHOD();
5458 portPipeLabel->Location = System::Drawing::Point(Width - 324, 65);
5459 textBoxDiagPortPipe->Location = System::Drawing::Point(Width - 221, 62);
5460 textBoxDiagPortPipe->Size = System::Drawing::Size(181, 22);
5464 if (comboBoxDiagIpcType->Items->Count == 0)
5466 comboBoxDiagIpcType->Items->AddRange(Util::Util::ArrayIpcTypes2String());
5467 comboBoxDiagIpcType->SelectedItem = Util::Util::ToString(Setting::UserSettings::GetInstance().GetDiagIpcType());
5470 if (comboBoxDiagManagerTraceLevel->Items->Count == 0)
5472 comboBoxDiagManagerTraceLevel->Items->AddRange(Util::Util::ArrayDiagLoggerLevels2String());
5473 comboBoxDiagManagerTraceLevel->SelectedItem = Util::Util::ToString(Setting::UserSettings::GetInstance().GetDiagManagerTraceLevel());
5476 if (comboBoxDiagLoggingTraceLevel->Items->Count == 0)
5478 comboBoxDiagLoggingTraceLevel->Items->AddRange(Util::Util::ArrayDiagnosticLogLevels2String());
5479 comboBoxDiagLoggingTraceLevel->SelectedItem = Util::Util::ToString(Setting::UserSettings::GetInstance().GetDiagLoggingTraceLevel());
5481 REFAPP_END_METHOD();
5484 System::Void SampleForm::comboBoxDiagIpcType_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
5486 REFAPP_START_METHOD();
5487 labelOdxProject->Hide();
5488 comboBoxODXProject->Hide();
5489 labelODXVehicle->Hide();
5490 comboBoxODXVehicle->Hide();
5492 portPipeLabel->Hide();
5493 textBoxDiagPortPipe->Hide();
5495 textBoxDiagManagerLicenseKey->Enabled =
false;
5496 comboBoxDiagManagerTraceLevel->Enabled =
false;
5497 checkBoxIncludedDiagLogging->Enabled =
false;
5498 comboBoxDiagLoggingTraceLevel->Enabled =
false;
5499 textBoxDiagManagerTraceFolder->Enabled =
false;
5500 buttonOpenDiagLoggingTraceFolder->Enabled =
false;
5501 buttonBrowseDiagLoggingTraceFolder->Enabled =
false;
5503 IpcTypes diagIpcType = Util::Util::ToIpcType(comboBoxDiagIpcType->SelectedItem->ToString());
5504 switch (diagIpcType)
5508 labelOdxProject->Show();
5509 comboBoxODXProject->Show();
5510 labelODXVehicle->Show();
5511 comboBoxODXVehicle->Show();
5513 textBoxDiagManagerLicenseKey->Enabled =
true;
5514 comboBoxDiagManagerTraceLevel->Enabled =
true;
5515 checkBoxIncludedDiagLogging->Enabled =
true;
5516 comboBoxDiagLoggingTraceLevel->Enabled = checkBoxIncludedDiagLogging->Checked;
5517 textBoxDiagManagerTraceFolder->Enabled =
true;
5518 buttonOpenDiagLoggingTraceFolder->Enabled =
true;
5519 buttonBrowseDiagLoggingTraceFolder->Enabled =
true;
5521 InitializeODXProject();
5524 case IpcTypes::Socket:
5526 portPipeLabel->Show();
5527 portPipeLabel->Text =
"DiagManager Ports";
5529 textBoxDiagPortPipe->Show();
5530 textBoxDiagPortPipe->Text = piml->DefaultDiagPort.ToString();
5531 textBoxDiagPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
5535 case IpcTypes::Pipe:
5537 portPipeLabel->Show();
5538 portPipeLabel->Text =
"DiagManager Pipes";
5540 textBoxDiagPortPipe->Show();
5541 textBoxDiagPortPipe->Text = Util::Util::ToString(piml->DefaultDiagPipeName);
5542 textBoxDiagPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
5548 piml->GlobalRuntimeManager = CreateRuntimeManager();
5549 REFAPP_END_METHOD();
5552 System::Void SampleForm::checkBoxIncludedDiagLogging_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
5554 REFAPP_START_METHOD();
5555 if (IsDiagIpcRaw() ==
false)
5557 REFAPP_END_METHOD();
5561 comboBoxDiagLoggingTraceLevel->Enabled = checkBoxIncludedDiagLogging->Checked;
5563 UpdateDiagLogging();
5564 REFAPP_END_METHOD();
5567 System::Void SampleForm::buttonOpenDiagLoggingTraceFolder_Click(System::Object^ sender, System::EventArgs^ e)
5569 REFAPP_START_METHOD();
5570 if (IsDiagIpcRaw() ==
false)
5572 REFAPP_END_METHOD();
5576 System::String^ path = textBoxDiagManagerTraceFolder->Text;
5577 if (System::IO::Directory::Exists(path))
5579 System::Diagnostics::Process::Start(path);
5581 REFAPP_END_METHOD();
5584 System::Void SampleForm::buttonBrowseDiagLoggingTraceFolder_Click(System::Object^ sender, System::EventArgs^ e)
5586 REFAPP_START_METHOD();
5587 if (IsDiagIpcRaw() ==
false)
5589 REFAPP_END_METHOD();
5593 folderBrowserDialog1->SelectedPath = textBoxDiagManagerTraceFolder->Text;
5594 folderBrowserDialog1->ShowNewFolderButton =
true;
5596 System::Windows::Forms::DialogResult result = folderBrowserDialog1->ShowDialog();
5597 if (result == System::Windows::Forms::DialogResult::OK)
5599 textBoxDiagManagerTraceFolder->Text = folderBrowserDialog1->SelectedPath;
5601 REFAPP_END_METHOD();
5604 System::Void SampleForm::textBoxDiagManagerLicenseKey_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e)
5606 REFAPP_START_METHOD();
5607 if (IsDiagIpcRaw() ==
false)
5609 REFAPP_END_METHOD();
5613 if (e->KeyCode == System::Windows::Forms::Keys::Delete || e->KeyCode == System::Windows::Forms::Keys::Back)
5615 textBoxDiagManagerLicenseKey->Clear();
5617 REFAPP_END_METHOD();
5620 System::Void SampleForm::textBoxDiagManagerLicenseKey_TextChanged(System::Object^ sender, System::EventArgs^ e)
5622 REFAPP_START_METHOD();
5623 if (IsDiagIpcRaw() ==
false)
5625 REFAPP_END_METHOD();
5629 System::Windows::Forms::TextBox^ textBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(sender);
5630 System::String^ inputRemoveHyphen = textBox->Text->Replace(
"-",
"");
5632 System::Text::StringBuilder^ formattedLicenseKey =
gcnew System::Text::StringBuilder();
5633 for (
int i = 0; i < inputRemoveHyphen->Length; i++)
5635 formattedLicenseKey->Append(inputRemoveHyphen[i]);
5636 if ((i + 1) % 5 == 0 && i + 1 < inputRemoveHyphen->Length)
5638 formattedLicenseKey->Append(
"-");
5642 textBoxDiagManagerLicenseKey->Text = formattedLicenseKey->ToString();
5643 textBoxDiagManagerLicenseKey->SelectionStart = textBoxDiagManagerLicenseKey->Text->Length;
5645 std::string licenseKey = Util::Util::ToString(textBoxDiagManagerLicenseKey->Text);
5646 if (Util::LicenseUtil::CheckLicenseFormat(licenseKey))
5648 this->piml->ErrorProvider->Clear();
5651 std::shared_ptr<OpenTestSystem::Otx::DiagManager::OtxDiagApi::IOtxDiag> otxDiag = Util::OtxDiagUtil::RawOtxDiag(licenseKey);
5652 InitializeODXProject();
5654 if (Util::OtxDiagUtil::RawOtxDiag() !=
nullptr)
5656 piml->ErrorProvider->SetError(textBoxDiagManagerLicenseKey,
"");
5659 catch (
const std::exception& ex)
5661 piml->ErrorProvider->SetError(textBoxDiagManagerLicenseKey, Util::Util::ToString(ex.what()));
5663 catch (System::Exception^ ex)
5665 piml->ErrorProvider->SetError(textBoxDiagManagerLicenseKey, ex->Message);
5669 piml->ErrorProvider->SetError(textBoxDiagManagerLicenseKey,
"License key invalid.");
5674 piml->GlobalRuntimeManager = CreateRuntimeManager();
5676 catch (
const std::exception& ex)
5680 catch (System::Exception^ ex)
5687 this->piml->ErrorProvider->SetError(textBoxDiagManagerLicenseKey,
"License key does not match the desired format XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.");
5688 this->comboBoxODXProject->Items->Clear();
5689 this->comboBoxODXProject->Items->Add(
"");
5690 this->comboBoxODXProject->SelectedIndex = 0;
5692 REFAPP_END_METHOD();
5695 System::Void SampleForm::comboBoxDiagManagerTraceLevel_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
5697 REFAPP_START_METHOD();
5698 if (IsDiagIpcRaw() ==
false || Util::OtxDiagUtil::RawOtxDiag() ==
nullptr)
5700 REFAPP_END_METHOD();
5706 Util::OtxDiagUtil::SetLevelLogger(loggerLevel);
5707 PrintTextCallback(
"Updated trace level");
5708 REFAPP_END_METHOD();
5711 void SampleForm::UpdateDiagLogging()
5713 REFAPP_START_METHOD();
5714 if (IsDiagIpcRaw() ==
false || Util::OtxDiagUtil::RawOtxDiag() ==
nullptr)
5716 REFAPP_END_METHOD();
5722 System::String^ stringDiagTraceFolder = textBoxDiagManagerTraceFolder->Text->Trim();
5723 std::string diagTraceFolder = System::String::IsNullOrEmpty(stringDiagTraceFolder) ?
"" : Util::Util::ToString(stringDiagTraceFolder);
5724 int logLevel = Util::OtxDiagUtil::GetDiagnosticLogLevelDefault();
5726 if (checkBoxIncludedDiagLogging->Checked && comboBoxDiagLoggingTraceLevel->SelectedItem !=
nullptr)
5728 logLevel = Util::Util::ToDiagDiagnosticsLogLevel(comboBoxDiagLoggingTraceLevel->SelectedItem->ToString());
5731 Util::OtxDiagUtil::SetDiagDiagnosticLogging(logLevel, diagTraceFolder);
5733 catch (
const std::exception& ex)
5737 catch (System::Exception^ ex)
5742 REFAPP_END_METHOD();
5745 System::Void SampleForm::comboBoxDiagLoggingTraceLevel_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
5747 if (IsDiagIpcRaw() ==
false)
5752 UpdateDiagLogging();
5755 System::Void SampleForm::textBoxDiagManagerTraceFolder_TextChanged(System::Object^ sender, System::EventArgs^ e)
5757 REFAPP_START_METHOD();
5758 if (IsDiagIpcRaw() ==
false || Util::OtxDiagUtil::RawOtxDiag() ==
nullptr)
5760 REFAPP_END_METHOD();
5766 std::string diagTraceFolder = Util::Util::ToString(textBoxDiagManagerTraceFolder->Text);
5768 Util::OtxDiagUtil::SetPathLogger(diagTraceFolder);
5769 UpdateDiagLogging();
5770 PrintTextCallback(
"Updated DiagManager trace folder");
5772 catch (
const std::exception& ex)
5776 catch (System::Exception^ ex)
5781 REFAPP_END_METHOD();
5784 bool SampleForm::IsDiagIpcRaw()
5786 REFAPP_START_METHOD();
5787 bool result =
false;
5788 System::String^ ipcValue, ^ ipcDiagValue;
5792 if (Util::Util::IsInstance<System::Windows::Forms::ComboBox^>(comboBoxIpcType) &&
5793 Util::Util::IsInstance<System::Windows::Forms::ComboBox^>(comboBoxDiagIpcType) &&
5794 comboBoxIpcType->SelectedItem !=
nullptr &&
5795 comboBoxDiagIpcType->SelectedItem !=
nullptr)
5797 ipcValue = comboBoxIpcType->SelectedItem->ToString();
5798 ipcDiagValue = comboBoxDiagIpcType->SelectedItem->ToString();
5799 result = Util::Util::ToIpcType(ipcValue) == IpcTypes::Raw && Util::Util::ToIpcType(ipcDiagValue) == IpcTypes::Raw;
5803 REFAPP_END_METHOD();
Level
Log level
Definition: ILog.h:49
LogLevels
Levels for logging of diagnostic communication
Definition: INoneOtxDiag.h:21
static void SetLicenseKey(const std::string &licenseKey)
Sets a valid license key to release the API.
TraceLevels GetTraceLevel() const
Gets OTX-Runtime Tracing Level. The Tracing is the internal logging of the API. Default value: ERROR.
bool SetTraceFolder(const std::string &path)
Sets directory where the trace files are stored.
bool SetTraceLevel(const TraceLevels traceLevel)
Sets OTX-Runtime Tracing Level. The Tracing is the internal logging of the API. Default value: ERROR.
static RuntimeConfig & GetInstance()
Get RuntimeConfig Instance
ExecutionStateChangeReason
Reason, why a procedure execution state was changed, e.g. Paused or Running
Definition: ExecutionStateChangeReason.h:12
ClampState
Contains the state of a clamp
Definition: ClampState.h:12
@ On
The clamp state is ON
@ NotAvailable
The clamp state cannot be determined (default)
ExpectedState
Contains the expected state of the diagnostic connection
Definition: ExpectedState.h:12
@ BatteryOn
The connection state is battery ON, which means KL30 is On AND KL15 will be ignored
@ IgnitionOff
The connection state is ignition OFF, which means KL30 is On AND KL15 is Off OR KL15 is NotAvailable
@ IgnitionOn
The connection state is ignition ON, which means KL30 is On AND KL15 is On
3 #include "CustomImplTypes.h"
4 #include "IRuntimeManager.h"
5 #include "CLRWrapper.h"
7 #include <Project/IProject.h>
8 #include <Otx/IPackage.h>
9 #include <Otx/IDocument.h>
10 #include <Otx/IProcedure.h>
11 #include <KeyEventArgs.h>
12 #include <Exceptions/Exception.h>
17 namespace OpenTestSystem {
namespace Otx {
namespace Runtime2 {
namespace Api {
namespace Sample {
19 struct SampleFormImpl;
24 public ref class SampleForm :
public System::Windows::Forms::Form
29 InitializeComponent();
33 InitializeInternalComponent();
35 SampleForm(System::String^ title, SampleForm^ createForm);
54 private: System::Windows::Forms::Panel^ panel1;
55 private: System::Windows::Forms::Button^ buttonBrowseFile;
56 private: System::Windows::Forms::ComboBox^ cbFilePath;
57 private: System::Windows::Forms::Label^ label1;
58 private: System::Windows::Forms::Panel^ panel2;
59 private: System::Windows::Forms::OpenFileDialog^ openFileDialog1;
60 private: System::Windows::Forms::TextBox^ txtPassword;
61 private: System::Windows::Forms::Label^ passwordLabel;
62 private: System::Windows::Forms::SplitContainer^ splitContainer1;
63 private: System::Windows::Forms::TreeView^ treeViewOtxProject;
64 private: System::Windows::Forms::Label^ label3;
65 private: System::Windows::Forms::DataGridView^ gridViewParameter;
66 private: System::Windows::Forms::Label^ labelAdjustProcedureParameters;
67 private: System::Windows::Forms::Button^ buttonExecuteSelectedProcedure;
68 private: System::Windows::Forms::Button^ buttonReload;
69 private: System::Windows::Forms::SplitContainer^ splitContainer2;
70 private: System::Windows::Forms::SplitContainer^ splitContainer3;
71 private: System::Windows::Forms::Label^ label4;
72 private: System::Windows::Forms::DataGridView^ gridViewContext;
73 private: System::Windows::Forms::Label^ label5;
74 private: System::Windows::Forms::DataGridView^ gridViewState;
75 private: System::Windows::Forms::SplitContainer^ splitContainer4;
76 private: System::Windows::Forms::ComboBox^ comboBoxTraceLevel;
77 private: System::Windows::Forms::Label^ label8;
78 private: System::Windows::Forms::Label^ label6;
79 private: System::Windows::Forms::TextBox^ textBoxTraceFolder;
80 private: System::Windows::Forms::Label^ label9;
81 private: System::Windows::Forms::Button^ buttonBrowseTraceFolder;
82 private: System::Windows::Forms::ComboBox^ comboBoxIpcType;
83 private: System::Windows::Forms::Label^ label11;
84 private: System::Windows::Forms::Label^ label10;
85 private: System::Windows::Forms::Label^ portPipeLabel;
86 private: System::Windows::Forms::TextBox^ textBoxRtPortPipe;
87 private: System::Windows::Forms::Button^ buttonExecuteMain;
88 private: System::Windows::Forms::Button^ buttonStop;
89 private: System::Windows::Forms::CheckBox^ checkBoxCyclicExecution;
90 private: System::Windows::Forms::CheckBox^ checkBoxAsyncExecution;
91 private: System::Windows::Forms::Button^ buttonNewInstanceNewThread;
92 private: System::Windows::Forms::Button^ buttonNewInstance;
93 private: System::Windows::Forms::Label^ labelOutputOverflow;
94 private: System::Windows::Forms::Button^ buttonCopyRow;
95 private: System::Windows::Forms::Button^ buttonClearOutput;
96 private: System::Windows::Forms::ListBox^ listBoxOuput;
97 private: System::Windows::Forms::FolderBrowserDialog^ folderBrowserDialog1;
98 private: System::Windows::Forms::ImageList^ imageList1;
99 private: System::Windows::Forms::SplitContainer^ splitContainer5;
100 private: System::Windows::Forms::GroupBox^ groupBox1;
101 private: System::Windows::Forms::RadioButton^ radioButtonDefaultImplementation;
102 private: System::Windows::Forms::RadioButton^ radioButtonOuputWindow;
103 private: System::Windows::Forms::RadioButton^ radioButtonNoCustomImplementation;
104 private: System::Windows::Forms::Panel^ panel3;
105 private: System::Windows::Forms::Panel^ panel4;
106 private: System::Windows::Forms::Button^ buttonWriteSettings;
107 private: System::Windows::Forms::Button^ buttonReadSettings;
108 private: System::Windows::Forms::DataGridView^ gridViewSettings;
109 private: System::Windows::Forms::Label^ label12;
110 private: System::Windows::Forms::CheckBox^ buttonHmi;
111 private: System::Windows::Forms::CheckBox^ checkBoxCyclicReload;
112 private: System::Windows::Forms::Label^ label13;
113 private: System::Windows::Forms::Label^ label15;
114 private: System::Windows::Forms::Label^ label14;
115 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnSettingName;
116 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnSettingValue;
117 private: System::Windows::Forms::CheckBox^ checkBoxAdd2Output;
118 private: System::Windows::Forms::CheckBox^ checkBoxNewRuntimeManager;
119 private: System::Windows::Forms::TextBox^ textBoxRuntimeContextName;
120 private: System::Windows::Forms::Label^ runtimeNameLabel;
121 private: System::Windows::Forms::CheckBox^ buttonPause;
122 private: System::Windows::Forms::CheckBox^ checkBoxIgnition;
123 private: System::Windows::Forms::CheckBox^ checkBoxUseConnectionState;
124 private: System::Windows::Forms::TextBox^ textBoxVoltageThreshold;
125 private: System::Windows::Forms::Label^ labelVoltageThreshold;
126 private: System::Windows::Forms::TextBox^ textBoxPollingTime;
127 private: System::Windows::Forms::Label^ labelPollingTime;
128 private: System::Windows::Forms::Label^ labelTimeout;
129 private: System::Windows::Forms::TextBox^ textBoxTimeout;
130 private: System::Windows::Forms::TextBox^ textBoxDiagPortPipe;
131 private: System::Windows::Forms::Button^ buttonOpenTraceFolder;
132 private: System::Windows::Forms::Label^ labelSeparator2;
133 private: System::Windows::Forms::Label^ labelProcedureExecutionState;
134 private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanelExecutionState;
135 private: System::Windows::Forms::Label^ label18;
136 private: System::Windows::Forms::Label^ labelExpectedState;
137 private: System::Windows::Forms::Label^ labelSeparator3;
138 private: System::Windows::Forms::Label^ labelSeparator4;
139 private: System::Windows::Forms::Label^ labelSeparator1;
140 private: System::Windows::Forms::Label^ labelBatteryState;
141 private: System::Windows::Forms::Label^ labelIconProcedureExecutionState;
142 private: System::Windows::Forms::Button^ buttonCheckBatteryIgnition;
143 private: System::Windows::Forms::Label^ labelIgnitionState;
144 private: System::Windows::Forms::CheckBox^ checkBoxStartAllParents;
145 private: System::Windows::Forms::TextBox^ textBoxTraceFileMaxSize;
146 private: System::Windows::Forms::TextBox^ textBoxTraceFileMaxCount;
147 private: System::Windows::Forms::Label^ label2;
148 private: System::Windows::Forms::Timer^ updateGuiTimer;
149 private: System::Windows::Forms::Label^ labelSeparator5;
150 private: System::Windows::Forms::Label^ labelProcedureExecutionTimes;
151 private: System::Windows::Forms::ToolTip^ toolTip1;
152 private: System::Windows::Forms::Button^ buttonStartStopWebServer;
153 private: System::Windows::Forms::Button^ buttonLicense;
154 private: System::ComponentModel::IContainer^ components;
155 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnName;
156 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnDirection;
157 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnDataType;
158 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnValue;
159 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnDetails;
160 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnContextName;
161 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnContextDataType;
162 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnContextValue;
163 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnContextDetails;
164 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnStateName;
165 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnStateDataType;
166 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnStateValue;
167 private: System::Windows::Forms::DataGridViewTextBoxColumn^ dataGridViewTextBoxColumnStateDetails;
168 private: System::Windows::Forms::ComboBox^ comboBoxODXProject;
169 private: System::Windows::Forms::ComboBox^ comboBoxODXVehicle;
170 private: System::Windows::Forms::Label^ labelDiagType;
171 private: System::Windows::Forms::Label^ labelOdxProject;
172 private: System::Windows::Forms::Label^ labelODXVehicle;
173 private: System::Windows::Forms::Label^ label7;
174 private: System::Windows::Forms::ComboBox^ comboBoxDiagIpcType;
175 private: System::Windows::Forms::CheckBox^ checkBoxIncludedDiagLogging;
176 private: System::Windows::Forms::ComboBox^ comboBoxDiagManagerTraceLevel;
177 private: System::Windows::Forms::Label^ label16;
178 private: System::Windows::Forms::TextBox^ textBoxDiagManagerLicenseKey;
179 private: System::Windows::Forms::ComboBox^ comboBoxDiagLoggingTraceLevel;
180 private: System::Windows::Forms::Label^ label17;
181 private: System::Windows::Forms::TextBox^ textBoxDiagManagerTraceFolder;
182 private: System::Windows::Forms::Label^ label19;
183 private: System::Windows::Forms::Button^ buttonBrowseDiagLoggingTraceFolder;
184 private: System::Windows::Forms::Button^ buttonOpenDiagLoggingTraceFolder;
185 private: System::Windows::Forms::TextBox^ textBoxProfilingSize;
186 private: System::Windows::Forms::CheckBox^ checkBoxProfiling;
194 SampleFormImpl* piml;
196 void RegisterSettingsEvent();
197 void InitializeInternalComponent();
198 void CreateCustomImpl();
199 void CreateDefaultCustomImpl();
200 void CreateOutputWindowCustomImpl();
201 void InitializeSampleDefaultValues();
203 void AddComboBoxFileOrPath(System::Windows::Forms::ComboBox^ comboBox);
204 void SetupTraceLevel();
205 void SetupTraceFolder();
206 void SetupTraceFileProfilerMaxCountAndSize();
207 void SetupDefaultPortAndPipeName();
208 void SetupCustomImplType();
209 void SetupWindowSize();
210 void SetupWindowLocation();
211 bool CheckFormIsInBound(System::Drawing::Point location);
213 void SetupPollingTime();
214 void SetupVoltageThreshold();
215 void UpdateWebServerButtonCallback();
216 void SetRuntimeContextName();
217 void SetTitle(System::String^ title);
218 void SetLocation(SampleForm^ creatorForm);
219 void PrintException(System::Exception^ ex);
220 void PrintException(System::Exception^ ex, System::String^ additionalText);
221 void PrintException(
const std::exception& ex);
222 void PrintException(
const std::exception& ex, System::String^ additionalText);
223 std::shared_ptr<IRuntimeManager> CreateRuntimeManager();
224 std::shared_ptr<IRuntimeManager> CreateRawRuntimeManager();
225 std::shared_ptr<IRuntimeManager> CreateSocketRuntimeManager();
226 std::shared_ptr<IRuntimeManager> CreatePipeRuntimeManager();
228 void InitializeRuntimeEvents(std::shared_ptr<IRuntimeManager> runtimeManager);
229 void SetCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager);
230 CustomImplTypes GetCurrentCustomImpl();
231 void SetOutputWindowImplementation(std::shared_ptr<IRuntimeManager> runtimeManager);
232 void SetDefaultCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager);
233 void RemoveCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager);
234 System::String^ GetTimeAndDurationStringSinceLastTimeAndUpdateLastTime();
235 void EnableConnectionState();
236 void SyncWithParent(System::Object^ parentControl);
237 void SyncWithParent(System::Object^ parentControl, System::Object^ control);
238 void SyncWithParent(System::Object^ parentControl, System::Object^ control,
bool newThread);
239 void ParentButtonClickCallback(System::Object^ state);
240 void TextBoxSetTextCallback(cli::array<System::Object^>^ arr);
241 void ParentTextBoxSetTextCallback(System::Object^ state);
242 void CheckBoxSetCheckStateCallback(cli::array<System::Object^>^ arr);
243 void ParentCheckBoxSetCheckStateCallback(System::Object^ state);
244 void ComboBoxSetIndexCallback(cli::array<System::Object^>^ arr);
245 void ParentComboBoxSetIndexCallback(System::Object^ state);
246 void NumericUpDownSetValueCallback(cli::array<System::Object^>^ arr);
247 void ParentNumericUpDownSetValueCallback(System::Object^ state);
248 System::String^ IpcPortPipeString();
249 void LoadContextFile(std::shared_ptr<IRuntimeManager> runtimeManager);
250 void ReloadContextFileCallback(CLRWrapper<std::shared_ptr<IRuntimeManager>>^ clrRuntimeManager);
251 void ClearSampleGUI();
252 std::shared_ptr<Project::IProject> LoadPtx(std::shared_ptr<IRuntimeManager> runtimeManager);
253 void ClearCustomImplemetationCaches();
254 void LoadPackage(std::shared_ptr<Project::IProject> project);
255 System::Windows::Forms::TreeNode^ CreatePackageNode(std::shared_ptr<IPackage> pack);
256 System::Windows::Forms::TreeNode^ CreateDocumentNode(std::shared_ptr<IDocument> doc);
257 System::Windows::Forms::TreeNode^ CreateProcedureName(std::shared_ptr<IProcedure> proc);
258 void ReadSettings(std::map<std::string, std::string> settings);
259 std::shared_ptr<Project::IPlayerProject> LoadPpx(std::shared_ptr<IRuntimeManager> runtimeManager);
260 System::Void HmiWindow_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e);
261 System::Void NewInstanceInThread();
262 void ExecuteProcedure();
263 void ExecuteProcedureSync(cli::array<System::Object^>^ args);
264 void CheckBatteryIgnitionState(std::shared_ptr<IRuntimeManager> runtimeManager);
266 void UpdateGridView(std::shared_ptr<IProcedure> procedure);
267 void UpdateGridviewParameter(std::shared_ptr<IProcedure> procedure);
268 void UpdateGridviewParameter(std::shared_ptr<IProcedureParameter> parameter);
269 System::String^ ConvertValue2String(std::shared_ptr<DataTypes::Object> value);
270 System::String^ GetDetails(std::shared_ptr<DataTypes::Object> value);
271 void UpdateGridViewContextVariable(std::shared_ptr<IDocument> document,
bool withPrefix, std::vector<std::string>& listItemReviewed);
272 void UpdateGridViewStateVariable(std::shared_ptr<IDocument> document,
bool withPrefix, std::vector<std::string>& listItemReviewed);
273 void DoCyclic(System::Object^ args);
274 void CheckCyclicReloadOrNewRuntimeManager(std::shared_ptr<IRuntimeManager> runtimeManager);
275 void CheckCyclicReloadOrNewRuntimeManager(std::shared_ptr<IRuntimeManager> runtimeManager,
bool waitCyclic);
276 void CheckCyclicReloadOrNewRuntimeManagerCallback(cli::array<System::Object^>^ arr);
277 void WaitCyclicExecuteAsyncIsProcessing();
278 void UpdateButtonStateAfterThrowException();
279 void UpdateExecutionStateButtons(
bool wasExecuted);
280 void UpdatePauseButton(
bool pauseAvailable);
281 void UpdatePauseButton(
bool pauseAvailable,
bool enabled);
282 void DisplayProcedureExecutionTimes();
284 void SaveSocketPortOrPipeName();
285 void SetExpectedState();
286 std::shared_ptr<Project::IProject> GetProject(std::shared_ptr<IProcedure> procedure);
292 void DisplayProcedureExecutionState(
IRuntimeContext* context, System::String^ errorMessage);
294 void StartStopUpdateGuiTimer();
296 std::string ShortenedValueString(std::shared_ptr<DataTypes::Object> value);
297 bool IsPauseEnabled();
298 bool IsContinueEnable();
300 void StartStopWebServerCallback();
302 void InitializeODXProject();
303 void SetupDiagManagerControls();
304 void UpdateDiagLogging();
308 void PrintTextCallback(System::String^ text);
309 void ReloadRuntimeManager();
310 void SetInstanceName(System::String^ instanceName);
311 void SetCreatorForm(SampleForm^ creatorForm);
313 void ProcedurePendingCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
314 void ProcedureStartedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
316 void ProcedurePausedCallback(cli::array<System::Object^>^ arr);
317 void ProcedureContinuedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
318 void ProcedureFinishedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
319 void ProcedureStoppedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
320 void ProcedureAbortedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
321 void ProcedureTimeoutCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
323 void DiagConnectionStateChangedCallback(cli::array<System::Object^>^ arr);
324 void InOutParameterValueChanged(
IRuntimeContext* context, IProcedureInOutParameter* parameter);
325 void InOutParameterValueChangedCallback(cli::array<System::Object^>^ arr);
326 void CustomScreenImplementation_KeyDown(std::shared_ptr<Custom::KeyEventArgs> eventArgs);
328 void ContextVariableRead(std::shared_ptr<IContextVariable> contextVariable, std::shared_ptr<DataTypes::Object> value);
329 void ContextVariableReadCallback(cli::array<System::Object^>^ arr);
330 void StateVariableValueChanged(std::shared_ptr<IStateVariable> stateVariable, std::shared_ptr<DataTypes::Object> value);
331 void StateVariableValueChangedCallback(cli::array<System::Object^>^ arr);
332 void UpdateGridViewStateVariable(std::shared_ptr<IStateVariable> stateVariable);
335 #pragma region Windows Form Designer generated code
340 void InitializeComponent(
void)
342 this->components = (
gcnew System::ComponentModel::Container());
343 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
344 System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle1 = (
gcnew System::Windows::Forms::DataGridViewCellStyle());
345 System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle2 = (
gcnew System::Windows::Forms::DataGridViewCellStyle());
346 System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle3 = (
gcnew System::Windows::Forms::DataGridViewCellStyle());
347 this->panel1 = (
gcnew System::Windows::Forms::Panel());
348 this->textBoxProfilingSize = (
gcnew System::Windows::Forms::TextBox());
349 this->checkBoxProfiling = (
gcnew System::Windows::Forms::CheckBox());
350 this->buttonBrowseDiagLoggingTraceFolder = (
gcnew System::Windows::Forms::Button());
351 this->buttonOpenDiagLoggingTraceFolder = (
gcnew System::Windows::Forms::Button());
352 this->textBoxDiagManagerTraceFolder = (
gcnew System::Windows::Forms::TextBox());
353 this->label19 = (
gcnew System::Windows::Forms::Label());
354 this->comboBoxDiagLoggingTraceLevel = (
gcnew System::Windows::Forms::ComboBox());
355 this->label17 = (
gcnew System::Windows::Forms::Label());
356 this->checkBoxIncludedDiagLogging = (
gcnew System::Windows::Forms::CheckBox());
357 this->comboBoxDiagManagerTraceLevel = (
gcnew System::Windows::Forms::ComboBox());
358 this->label16 = (
gcnew System::Windows::Forms::Label());
359 this->textBoxDiagManagerLicenseKey = (
gcnew System::Windows::Forms::TextBox());
360 this->label7 = (
gcnew System::Windows::Forms::Label());
361 this->comboBoxDiagIpcType = (
gcnew System::Windows::Forms::ComboBox());
362 this->labelDiagType = (
gcnew System::Windows::Forms::Label());
363 this->labelOdxProject = (
gcnew System::Windows::Forms::Label());
364 this->labelODXVehicle = (
gcnew System::Windows::Forms::Label());
365 this->comboBoxODXVehicle = (
gcnew System::Windows::Forms::ComboBox());
366 this->comboBoxODXProject = (
gcnew System::Windows::Forms::ComboBox());
367 this->label2 = (
gcnew System::Windows::Forms::Label());
368 this->textBoxTraceFileMaxSize = (
gcnew System::Windows::Forms::TextBox());
369 this->textBoxTraceFileMaxCount = (
gcnew System::Windows::Forms::TextBox());
370 this->buttonOpenTraceFolder = (
gcnew System::Windows::Forms::Button());
371 this->textBoxRuntimeContextName = (
gcnew System::Windows::Forms::TextBox());
372 this->runtimeNameLabel = (
gcnew System::Windows::Forms::Label());
373 this->textBoxDiagPortPipe = (
gcnew System::Windows::Forms::TextBox());
374 this->textBoxRtPortPipe = (
gcnew System::Windows::Forms::TextBox());
375 this->label13 = (
gcnew System::Windows::Forms::Label());
376 this->portPipeLabel = (
gcnew System::Windows::Forms::Label());
377 this->comboBoxIpcType = (
gcnew System::Windows::Forms::ComboBox());
378 this->label11 = (
gcnew System::Windows::Forms::Label());
379 this->label10 = (
gcnew System::Windows::Forms::Label());
380 this->buttonBrowseTraceFolder = (
gcnew System::Windows::Forms::Button());
381 this->textBoxTraceFolder = (
gcnew System::Windows::Forms::TextBox());
382 this->label9 = (
gcnew System::Windows::Forms::Label());
383 this->comboBoxTraceLevel = (
gcnew System::Windows::Forms::ComboBox());
384 this->label8 = (
gcnew System::Windows::Forms::Label());
385 this->label6 = (
gcnew System::Windows::Forms::Label());
386 this->buttonReload = (
gcnew System::Windows::Forms::Button());
387 this->txtPassword = (
gcnew System::Windows::Forms::TextBox());
388 this->passwordLabel = (
gcnew System::Windows::Forms::Label());
389 this->buttonBrowseFile = (
gcnew System::Windows::Forms::Button());
390 this->cbFilePath = (
gcnew System::Windows::Forms::ComboBox());
391 this->label1 = (
gcnew System::Windows::Forms::Label());
392 this->textBoxTimeout = (
gcnew System::Windows::Forms::TextBox());
393 this->labelTimeout = (
gcnew System::Windows::Forms::Label());
394 this->textBoxVoltageThreshold = (
gcnew System::Windows::Forms::TextBox());
395 this->labelVoltageThreshold = (
gcnew System::Windows::Forms::Label());
396 this->textBoxPollingTime = (
gcnew System::Windows::Forms::TextBox());
397 this->labelPollingTime = (
gcnew System::Windows::Forms::Label());
398 this->checkBoxIgnition = (
gcnew System::Windows::Forms::CheckBox());
399 this->checkBoxUseConnectionState = (
gcnew System::Windows::Forms::CheckBox());
400 this->panel2 = (
gcnew System::Windows::Forms::Panel());
401 this->buttonLicense = (
gcnew System::Windows::Forms::Button());
402 this->buttonStartStopWebServer = (
gcnew System::Windows::Forms::Button());
403 this->buttonHmi = (
gcnew System::Windows::Forms::CheckBox());
404 this->checkBoxNewRuntimeManager = (
gcnew System::Windows::Forms::CheckBox());
405 this->label15 = (
gcnew System::Windows::Forms::Label());
406 this->label14 = (
gcnew System::Windows::Forms::Label());
407 this->checkBoxCyclicReload = (
gcnew System::Windows::Forms::CheckBox());
408 this->listBoxOuput = (
gcnew System::Windows::Forms::ListBox());
409 this->labelOutputOverflow = (
gcnew System::Windows::Forms::Label());
410 this->buttonCopyRow = (
gcnew System::Windows::Forms::Button());
411 this->buttonClearOutput = (
gcnew System::Windows::Forms::Button());
412 this->buttonNewInstanceNewThread = (
gcnew System::Windows::Forms::Button());
413 this->buttonNewInstance = (
gcnew System::Windows::Forms::Button());
414 this->checkBoxStartAllParents = (
gcnew System::Windows::Forms::CheckBox());
415 this->checkBoxAdd2Output = (
gcnew System::Windows::Forms::CheckBox());
416 this->checkBoxCyclicExecution = (
gcnew System::Windows::Forms::CheckBox());
417 this->checkBoxAsyncExecution = (
gcnew System::Windows::Forms::CheckBox());
418 this->buttonPause = (
gcnew System::Windows::Forms::CheckBox());
419 this->buttonStop = (
gcnew System::Windows::Forms::Button());
420 this->buttonExecuteMain = (
gcnew System::Windows::Forms::Button());
421 this->buttonExecuteSelectedProcedure = (
gcnew System::Windows::Forms::Button());
422 this->openFileDialog1 = (
gcnew System::Windows::Forms::OpenFileDialog());
423 this->splitContainer1 = (
gcnew System::Windows::Forms::SplitContainer());
424 this->treeViewOtxProject = (
gcnew System::Windows::Forms::TreeView());
425 this->label3 = (
gcnew System::Windows::Forms::Label());
426 this->splitContainer5 = (
gcnew System::Windows::Forms::SplitContainer());
427 this->splitContainer2 = (
gcnew System::Windows::Forms::SplitContainer());
428 this->gridViewParameter = (
gcnew System::Windows::Forms::DataGridView());
429 this->dataGridViewTextBoxColumnName = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
430 this->dataGridViewTextBoxColumnDirection = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
431 this->dataGridViewTextBoxColumnDataType = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
432 this->dataGridViewTextBoxColumnValue = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
433 this->dataGridViewTextBoxColumnDetails = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
434 this->labelAdjustProcedureParameters = (
gcnew System::Windows::Forms::Label());
435 this->splitContainer3 = (
gcnew System::Windows::Forms::SplitContainer());
436 this->gridViewContext = (
gcnew System::Windows::Forms::DataGridView());
437 this->dataGridViewTextBoxColumnContextName = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
438 this->dataGridViewTextBoxColumnContextDataType = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
439 this->dataGridViewTextBoxColumnContextValue = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
440 this->dataGridViewTextBoxColumnContextDetails = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
441 this->label4 = (
gcnew System::Windows::Forms::Label());
442 this->gridViewState = (
gcnew System::Windows::Forms::DataGridView());
443 this->dataGridViewTextBoxColumnStateName = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
444 this->dataGridViewTextBoxColumnStateDataType = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
445 this->dataGridViewTextBoxColumnStateValue = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
446 this->dataGridViewTextBoxColumnStateDetails = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
447 this->label5 = (
gcnew System::Windows::Forms::Label());
448 this->panel3 = (
gcnew System::Windows::Forms::Panel());
449 this->gridViewSettings = (
gcnew System::Windows::Forms::DataGridView());
450 this->dataGridViewTextBoxColumnSettingName = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
451 this->dataGridViewTextBoxColumnSettingValue = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
452 this->panel4 = (
gcnew System::Windows::Forms::Panel());
453 this->label12 = (
gcnew System::Windows::Forms::Label());
454 this->buttonWriteSettings = (
gcnew System::Windows::Forms::Button());
455 this->buttonReadSettings = (
gcnew System::Windows::Forms::Button());
456 this->groupBox1 = (
gcnew System::Windows::Forms::GroupBox());
457 this->radioButtonNoCustomImplementation = (
gcnew System::Windows::Forms::RadioButton());
458 this->radioButtonDefaultImplementation = (
gcnew System::Windows::Forms::RadioButton());
459 this->radioButtonOuputWindow = (
gcnew System::Windows::Forms::RadioButton());
460 this->splitContainer4 = (
gcnew System::Windows::Forms::SplitContainer());
461 this->folderBrowserDialog1 = (
gcnew System::Windows::Forms::FolderBrowserDialog());
462 this->imageList1 = (
gcnew System::Windows::Forms::ImageList(this->components));
463 this->labelSeparator2 = (
gcnew System::Windows::Forms::Label());
464 this->labelProcedureExecutionState = (
gcnew System::Windows::Forms::Label());
465 this->tableLayoutPanelExecutionState = (
gcnew System::Windows::Forms::TableLayoutPanel());
466 this->labelIconProcedureExecutionState = (
gcnew System::Windows::Forms::Label());
467 this->labelBatteryState = (
gcnew System::Windows::Forms::Label());
468 this->labelExpectedState = (
gcnew System::Windows::Forms::Label());
469 this->labelSeparator3 = (
gcnew System::Windows::Forms::Label());
470 this->labelSeparator4 = (
gcnew System::Windows::Forms::Label());
471 this->labelSeparator1 = (
gcnew System::Windows::Forms::Label());
472 this->buttonCheckBatteryIgnition = (
gcnew System::Windows::Forms::Button());
473 this->labelIgnitionState = (
gcnew System::Windows::Forms::Label());
474 this->labelSeparator5 = (
gcnew System::Windows::Forms::Label());
475 this->labelProcedureExecutionTimes = (
gcnew System::Windows::Forms::Label());
476 this->label18 = (
gcnew System::Windows::Forms::Label());
477 this->updateGuiTimer = (
gcnew System::Windows::Forms::Timer(this->components));
478 this->toolTip1 = (
gcnew System::Windows::Forms::ToolTip(this->components));
479 this->panel1->SuspendLayout();
480 this->panel2->SuspendLayout();
481 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer1))->BeginInit();
482 this->splitContainer1->Panel1->SuspendLayout();
483 this->splitContainer1->Panel2->SuspendLayout();
484 this->splitContainer1->SuspendLayout();
485 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer5))->BeginInit();
486 this->splitContainer5->Panel1->SuspendLayout();
487 this->splitContainer5->Panel2->SuspendLayout();
488 this->splitContainer5->SuspendLayout();
489 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer2))->BeginInit();
490 this->splitContainer2->Panel1->SuspendLayout();
491 this->splitContainer2->Panel2->SuspendLayout();
492 this->splitContainer2->SuspendLayout();
493 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewParameter))->BeginInit();
494 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer3))->BeginInit();
495 this->splitContainer3->Panel1->SuspendLayout();
496 this->splitContainer3->Panel2->SuspendLayout();
497 this->splitContainer3->SuspendLayout();
498 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewContext))->BeginInit();
499 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewState))->BeginInit();
500 this->panel3->SuspendLayout();
501 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewSettings))->BeginInit();
502 this->panel4->SuspendLayout();
503 this->groupBox1->SuspendLayout();
504 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer4))->BeginInit();
505 this->splitContainer4->Panel1->SuspendLayout();
506 this->splitContainer4->Panel2->SuspendLayout();
507 this->splitContainer4->SuspendLayout();
508 this->tableLayoutPanelExecutionState->SuspendLayout();
509 this->SuspendLayout();
513 this->panel1->Controls->Add(this->textBoxProfilingSize);
514 this->panel1->Controls->Add(this->checkBoxProfiling);
515 this->panel1->Controls->Add(this->buttonBrowseDiagLoggingTraceFolder);
516 this->panel1->Controls->Add(this->buttonOpenDiagLoggingTraceFolder);
517 this->panel1->Controls->Add(this->textBoxDiagManagerTraceFolder);
518 this->panel1->Controls->Add(this->label19);
519 this->panel1->Controls->Add(this->comboBoxDiagLoggingTraceLevel);
520 this->panel1->Controls->Add(this->label17);
521 this->panel1->Controls->Add(this->checkBoxIncludedDiagLogging);
522 this->panel1->Controls->Add(this->comboBoxDiagManagerTraceLevel);
523 this->panel1->Controls->Add(this->label16);
524 this->panel1->Controls->Add(this->textBoxDiagManagerLicenseKey);
525 this->panel1->Controls->Add(this->label7);
526 this->panel1->Controls->Add(this->comboBoxDiagIpcType);
527 this->panel1->Controls->Add(this->labelDiagType);
528 this->panel1->Controls->Add(this->labelOdxProject);
529 this->panel1->Controls->Add(this->labelODXVehicle);
530 this->panel1->Controls->Add(this->comboBoxODXVehicle);
531 this->panel1->Controls->Add(this->comboBoxODXProject);
532 this->panel1->Controls->Add(this->label2);
533 this->panel1->Controls->Add(this->textBoxTraceFileMaxSize);
534 this->panel1->Controls->Add(this->textBoxTraceFileMaxCount);
535 this->panel1->Controls->Add(this->buttonOpenTraceFolder);
536 this->panel1->Controls->Add(this->textBoxRuntimeContextName);
537 this->panel1->Controls->Add(this->runtimeNameLabel);
538 this->panel1->Controls->Add(this->textBoxDiagPortPipe);
539 this->panel1->Controls->Add(this->textBoxRtPortPipe);
540 this->panel1->Controls->Add(this->label13);
541 this->panel1->Controls->Add(this->portPipeLabel);
542 this->panel1->Controls->Add(this->comboBoxIpcType);
543 this->panel1->Controls->Add(this->label11);
544 this->panel1->Controls->Add(this->label10);
545 this->panel1->Controls->Add(this->buttonBrowseTraceFolder);
546 this->panel1->Controls->Add(this->textBoxTraceFolder);
547 this->panel1->Controls->Add(this->label9);
548 this->panel1->Controls->Add(this->comboBoxTraceLevel);
549 this->panel1->Controls->Add(this->label8);
550 this->panel1->Controls->Add(this->label6);
551 this->panel1->Controls->Add(this->buttonReload);
552 this->panel1->Controls->Add(this->txtPassword);
553 this->panel1->Controls->Add(this->passwordLabel);
554 this->panel1->Controls->Add(this->buttonBrowseFile);
555 this->panel1->Controls->Add(this->cbFilePath);
556 this->panel1->Controls->Add(this->label1);
557 this->panel1->Dock = System::Windows::Forms::DockStyle::Top;
558 this->panel1->Location = System::Drawing::Point(0, 0);
559 this->panel1->Name = L
"panel1";
560 this->panel1->Padding = System::Windows::Forms::Padding(0, 0, 0, 6);
561 this->panel1->Size = System::Drawing::Size(1328, 115);
562 this->panel1->TabIndex = 0;
566 this->textBoxProfilingSize->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
567 this->textBoxProfilingSize->Location = System::Drawing::Point(391, 30);
568 this->textBoxProfilingSize->Name = L
"textBoxProfilingSize";
569 this->textBoxProfilingSize->Size = System::Drawing::Size(32, 22);
570 this->textBoxProfilingSize->TabIndex = 47;
571 this->textBoxProfilingSize->Text = L
"100";
572 this->textBoxProfilingSize->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
573 this->textBoxProfilingSize->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxProfilingSize_TextChanged);
577 this->checkBoxProfiling->AutoSize =
true;
578 this->checkBoxProfiling->Location = System::Drawing::Point(296, 32);
579 this->checkBoxProfiling->Name = L
"checkBoxProfiling";
580 this->checkBoxProfiling->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
581 this->checkBoxProfiling->Size = System::Drawing::Size(89, 17);
582 this->checkBoxProfiling->TabIndex = 46;
583 this->checkBoxProfiling->Tag = L
"";
584 this->checkBoxProfiling->Text = L
"Profiling, Size";
585 this->checkBoxProfiling->UseVisualStyleBackColor =
true;
586 this->checkBoxProfiling->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxProfiling_CheckedChanged);
590 this->buttonBrowseDiagLoggingTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
591 this->buttonBrowseDiagLoggingTraceFolder->Location = System::Drawing::Point(1298, 86);
592 this->buttonBrowseDiagLoggingTraceFolder->Name = L
"buttonBrowseDiagLoggingTraceFolder";
593 this->buttonBrowseDiagLoggingTraceFolder->Size = System::Drawing::Size(30, 23);
594 this->buttonBrowseDiagLoggingTraceFolder->TabIndex = 45;
595 this->buttonBrowseDiagLoggingTraceFolder->Text = L
"...";
596 this->buttonBrowseDiagLoggingTraceFolder->UseVisualStyleBackColor =
true;
597 this->buttonBrowseDiagLoggingTraceFolder->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonBrowseDiagLoggingTraceFolder_Click);
601 this->buttonOpenDiagLoggingTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
602 this->buttonOpenDiagLoggingTraceFolder->Location = System::Drawing::Point(1210, 86);
603 this->buttonOpenDiagLoggingTraceFolder->Name = L
"buttonOpenDiagLoggingTraceFolder";
604 this->buttonOpenDiagLoggingTraceFolder->Size = System::Drawing::Size(82, 23);
605 this->buttonOpenDiagLoggingTraceFolder->TabIndex = 44;
606 this->buttonOpenDiagLoggingTraceFolder->Text = L
"Open Folder";
607 this->buttonOpenDiagLoggingTraceFolder->UseVisualStyleBackColor =
true;
608 this->buttonOpenDiagLoggingTraceFolder->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonOpenDiagLoggingTraceFolder_Click);
612 this->textBoxDiagManagerTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
613 this->textBoxDiagManagerTraceFolder->Location = System::Drawing::Point(1095, 88);
614 this->textBoxDiagManagerTraceFolder->Name = L
"textBoxDiagManagerTraceFolder";
615 this->textBoxDiagManagerTraceFolder->Size = System::Drawing::Size(109, 20);
616 this->textBoxDiagManagerTraceFolder->TabIndex = 43;
617 this->textBoxDiagManagerTraceFolder->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxDiagManagerTraceFolder_TextChanged);
621 this->label19->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
622 this->label19->AutoSize =
true;
623 this->label19->Location = System::Drawing::Point(1073, 91);
624 this->label19->Name = L
"label19";
625 this->label19->Size = System::Drawing::Size(15, 13);
626 this->label19->TabIndex = 42;
627 this->label19->Text = L
"in";
631 this->comboBoxDiagLoggingTraceLevel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
632 this->comboBoxDiagLoggingTraceLevel->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
633 this->comboBoxDiagLoggingTraceLevel->Enabled =
false;
634 this->comboBoxDiagLoggingTraceLevel->FormattingEnabled =
true;
635 this->comboBoxDiagLoggingTraceLevel->Location = System::Drawing::Point(943, 88);
636 this->comboBoxDiagLoggingTraceLevel->Name = L
"comboBoxDiagLoggingTraceLevel";
637 this->comboBoxDiagLoggingTraceLevel->Size = System::Drawing::Size(124, 21);
638 this->comboBoxDiagLoggingTraceLevel->TabIndex = 41;
639 this->comboBoxDiagLoggingTraceLevel->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxDiagLoggingTraceLevel_SelectedValueChanged);
643 this->label17->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
644 this->label17->AutoSize =
true;
645 this->label17->Location = System::Drawing::Point(893, 91);
646 this->label17->Name = L
"label17";
647 this->label17->Size = System::Drawing::Size(44, 13);
648 this->label17->TabIndex = 40;
649 this->label17->Text = L
"at level:";
653 this->checkBoxIncludedDiagLogging->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
654 this->checkBoxIncludedDiagLogging->AutoSize =
true;
655 this->checkBoxIncludedDiagLogging->Location = System::Drawing::Point(760, 90);
656 this->checkBoxIncludedDiagLogging->Name = L
"checkBoxIncludedDiagLogging";
657 this->checkBoxIncludedDiagLogging->Size = System::Drawing::Size(129, 17);
658 this->checkBoxIncludedDiagLogging->TabIndex = 39;
659 this->checkBoxIncludedDiagLogging->Text = L
"included DiagLogging";
660 this->checkBoxIncludedDiagLogging->UseVisualStyleBackColor =
true;
661 this->checkBoxIncludedDiagLogging->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxIncludedDiagLogging_CheckedChanged);
665 this->comboBoxDiagManagerTraceLevel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
666 this->comboBoxDiagManagerTraceLevel->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
667 this->comboBoxDiagManagerTraceLevel->FormattingEnabled =
true;
668 this->comboBoxDiagManagerTraceLevel->Location = System::Drawing::Point(660, 88);
669 this->comboBoxDiagManagerTraceLevel->Name = L
"comboBoxDiagManagerTraceLevel";
670 this->comboBoxDiagManagerTraceLevel->Size = System::Drawing::Size(94, 21);
671 this->comboBoxDiagManagerTraceLevel->TabIndex = 38;
672 this->comboBoxDiagManagerTraceLevel->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxDiagManagerTraceLevel_SelectedValueChanged);
676 this->label16->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
677 this->label16->AutoSize =
true;
678 this->label16->Location = System::Drawing::Point(598, 91);
679 this->label16->Name = L
"label16";
680 this->label16->Size = System::Drawing::Size(59, 13);
681 this->label16->TabIndex = 37;
682 this->label16->Text = L
"trace level:";
686 this->textBoxDiagManagerLicenseKey->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
687 | System::Windows::Forms::AnchorStyles::Right));
688 this->textBoxDiagManagerLicenseKey->Location = System::Drawing::Point(128, 88);
689 this->textBoxDiagManagerLicenseKey->Name = L
"textBoxDiagManagerLicenseKey";
690 this->textBoxDiagManagerLicenseKey->PasswordChar =
'*';
691 this->textBoxDiagManagerLicenseKey->Size = System::Drawing::Size(456, 20);
692 this->textBoxDiagManagerLicenseKey->TabIndex = 36;
693 this->textBoxDiagManagerLicenseKey->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxDiagManagerLicenseKey_TextChanged);
694 this->textBoxDiagManagerLicenseKey->KeyDown +=
gcnew System::Windows::Forms::KeyEventHandler(
this, &SampleForm::textBoxDiagManagerLicenseKey_KeyDown);
698 this->label7->AutoSize =
true;
699 this->label7->Location = System::Drawing::Point(-3, 91);
700 this->label7->Name = L
"label7";
701 this->label7->Size = System::Drawing::Size(130, 13);
702 this->label7->TabIndex = 35;
703 this->label7->Text = L
"DiagManager license key:";
707 this->comboBoxDiagIpcType->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
708 this->comboBoxDiagIpcType->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
709 this->comboBoxDiagIpcType->FormattingEnabled =
true;
710 this->comboBoxDiagIpcType->Location = System::Drawing::Point(943, 61);
711 this->comboBoxDiagIpcType->Name = L
"comboBoxDiagIpcType";
712 this->comboBoxDiagIpcType->Size = System::Drawing::Size(93, 21);
713 this->comboBoxDiagIpcType->TabIndex = 34;
714 this->comboBoxDiagIpcType->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxDiagIpcType_SelectedValueChanged);
718 this->labelDiagType->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
719 this->labelDiagType->AutoSize =
true;
720 this->labelDiagType->Location = System::Drawing::Point(878, 65);
721 this->labelDiagType->Name = L
"labelDiagType";
722 this->labelDiagType->Size = System::Drawing::Size(59, 13);
723 this->labelDiagType->TabIndex = 33;
724 this->labelDiagType->Text = L
"Diag Type:";
728 this->labelOdxProject->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
729 this->labelOdxProject->AutoSize =
true;
730 this->labelOdxProject->Location = System::Drawing::Point(1046, 35);
731 this->labelOdxProject->Name = L
"labelOdxProject";
732 this->labelOdxProject->Size = System::Drawing::Size(43, 13);
733 this->labelOdxProject->TabIndex = 32;
734 this->labelOdxProject->Text = L
"Project:";
738 this->labelODXVehicle->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
739 this->labelODXVehicle->AutoSize =
true;
740 this->labelODXVehicle->Location = System::Drawing::Point(1044, 65);
741 this->labelODXVehicle->Name = L
"labelODXVehicle";
742 this->labelODXVehicle->Size = System::Drawing::Size(45, 13);
743 this->labelODXVehicle->TabIndex = 31;
744 this->labelODXVehicle->Text = L
"Vehicle:";
748 this->comboBoxODXVehicle->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
749 this->comboBoxODXVehicle->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
750 this->comboBoxODXVehicle->DropDownWidth = 120;
751 this->comboBoxODXVehicle->FormattingEnabled =
true;
752 this->comboBoxODXVehicle->Location = System::Drawing::Point(1095, 61);
753 this->comboBoxODXVehicle->Name = L
"comboBoxODXVehicle";
754 this->comboBoxODXVehicle->Size = System::Drawing::Size(233, 21);
755 this->comboBoxODXVehicle->TabIndex = 3;
756 this->comboBoxODXVehicle->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxODXVehicle_SelectedValueChanged);
760 this->comboBoxODXProject->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
761 this->comboBoxODXProject->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
762 this->comboBoxODXProject->DropDownWidth = 200;
763 this->comboBoxODXProject->FormattingEnabled =
true;
764 this->comboBoxODXProject->Location = System::Drawing::Point(1095, 31);
765 this->comboBoxODXProject->Name = L
"comboBoxODXProject";
766 this->comboBoxODXProject->Size = System::Drawing::Size(233, 21);
767 this->comboBoxODXProject->TabIndex = 4;
768 this->comboBoxODXProject->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxODXProject_SelectedValueChanged);
772 this->label2->AutoSize =
true;
773 this->label2->Location = System::Drawing::Point(165, 34);
774 this->label2->Name = L
"label2";
775 this->label2->Size = System::Drawing::Size(54, 13);
776 this->label2->TabIndex = 30;
777 this->label2->Text = L
"Files, Size";
781 this->textBoxTraceFileMaxSize->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
782 this->textBoxTraceFileMaxSize->Location = System::Drawing::Point(256, 30);
783 this->textBoxTraceFileMaxSize->Name = L
"textBoxTraceFileMaxSize";
784 this->textBoxTraceFileMaxSize->Size = System::Drawing::Size(32, 22);
785 this->textBoxTraceFileMaxSize->TabIndex = 29;
786 this->textBoxTraceFileMaxSize->Text = L
"100";
787 this->textBoxTraceFileMaxSize->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
788 this->textBoxTraceFileMaxSize->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxTraceFileMaxSize_TextChanged);
792 this->textBoxTraceFileMaxCount->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
793 this->textBoxTraceFileMaxCount->Location = System::Drawing::Point(225, 30);
794 this->textBoxTraceFileMaxCount->Name = L
"textBoxTraceFileMaxCount";
795 this->textBoxTraceFileMaxCount->Size = System::Drawing::Size(25, 22);
796 this->textBoxTraceFileMaxCount->TabIndex = 28;
797 this->textBoxTraceFileMaxCount->Text = L
"10";
798 this->textBoxTraceFileMaxCount->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
799 this->textBoxTraceFileMaxCount->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxTraceFileMaxCount_TextChanged);
803 this->buttonOpenTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
804 this->buttonOpenTraceFolder->Location = System::Drawing::Point(833, 30);
805 this->buttonOpenTraceFolder->Name = L
"buttonOpenTraceFolder";
806 this->buttonOpenTraceFolder->Size = System::Drawing::Size(49, 23);
807 this->buttonOpenTraceFolder->TabIndex = 15;
808 this->buttonOpenTraceFolder->Text = L
"Open...";
809 this->buttonOpenTraceFolder->UseVisualStyleBackColor =
true;
810 this->buttonOpenTraceFolder->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonOpenTraceFolder_Click);
814 this->textBoxRuntimeContextName->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
815 this->textBoxRuntimeContextName->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
816 this->textBoxRuntimeContextName->Location = System::Drawing::Point(1124, 2);
817 this->textBoxRuntimeContextName->Name = L
"textBoxRuntimeContextName";
818 this->textBoxRuntimeContextName->Size = System::Drawing::Size(123, 22);
819 this->textBoxRuntimeContextName->TabIndex = 8;
820 this->textBoxRuntimeContextName->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxRuntimeContextName_TextChanged);
824 this->runtimeNameLabel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
825 this->runtimeNameLabel->AutoSize =
true;
826 this->runtimeNameLabel->Location = System::Drawing::Point(1044, 5);
827 this->runtimeNameLabel->Name = L
"runtimeNameLabel";
828 this->runtimeNameLabel->Size = System::Drawing::Size(75, 13);
829 this->runtimeNameLabel->TabIndex = 7;
830 this->runtimeNameLabel->Text = L
"Runtime name";
834 this->textBoxDiagPortPipe->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
835 this->textBoxDiagPortPipe->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
836 static_cast<System::Byte
>(0)));
837 this->textBoxDiagPortPipe->Location = System::Drawing::Point(1273, 31);
838 this->textBoxDiagPortPipe->Name = L
"textBoxDiagPortPipe";
839 this->textBoxDiagPortPipe->Size = System::Drawing::Size(55, 22);
840 this->textBoxDiagPortPipe->TabIndex = 22;
841 this->textBoxDiagPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
845 this->textBoxRtPortPipe->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
846 this->textBoxRtPortPipe->BackColor = System::Drawing::SystemColors::Window;
847 this->textBoxRtPortPipe->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
848 static_cast<System::Byte
>(0)));
849 this->textBoxRtPortPipe->Location = System::Drawing::Point(1192, 31);
850 this->textBoxRtPortPipe->Name = L
"textBoxRtPortPipe";
851 this->textBoxRtPortPipe->Size = System::Drawing::Size(55, 22);
852 this->textBoxRtPortPipe->TabIndex = 20;
853 this->textBoxRtPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
857 this->label13->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
858 this->label13->AutoSize =
true;
859 this->label13->Location = System::Drawing::Point(1254, 34);
860 this->label13->Name = L
"label13";
861 this->label13->Size = System::Drawing::Size(12, 13);
862 this->label13->TabIndex = 21;
863 this->label13->Text = L
"/";
867 this->portPipeLabel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
868 this->portPipeLabel->AutoSize =
true;
869 this->portPipeLabel->Location = System::Drawing::Point(1044, 34);
870 this->portPipeLabel->Name = L
"portPipeLabel";
871 this->portPipeLabel->Size = System::Drawing::Size(144, 13);
872 this->portPipeLabel->TabIndex = 19;
873 this->portPipeLabel->Text = L
"Runner / DiagManager Ports";
877 this->comboBoxIpcType->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
878 this->comboBoxIpcType->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
879 this->comboBoxIpcType->DropDownWidth = 170;
880 this->comboBoxIpcType->FormattingEnabled =
true;
881 this->comboBoxIpcType->Location = System::Drawing::Point(943, 31);
882 this->comboBoxIpcType->Name = L
"comboBoxIpcType";
883 this->comboBoxIpcType->Size = System::Drawing::Size(93, 21);
884 this->comboBoxIpcType->TabIndex = 18;
885 this->comboBoxIpcType->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxIpcType_SelectedValueChanged);
889 this->label11->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
890 this->label11->AutoSize =
true;
891 this->label11->Location = System::Drawing::Point(895, 34);
892 this->label11->Name = L
"label11";
893 this->label11->Size = System::Drawing::Size(24, 13);
894 this->label11->TabIndex = 17;
895 this->label11->Text = L
"IPC";
899 this->label10->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
900 this->label10->BackColor = System::Drawing::SystemColors::ControlDark;
901 this->label10->Location = System::Drawing::Point(888, 35);
902 this->label10->Name = L
"label10";
903 this->label10->Size = System::Drawing::Size(1, 14);
904 this->label10->TabIndex = 16;
908 this->buttonBrowseTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
909 this->buttonBrowseTraceFolder->Location = System::Drawing::Point(798, 30);
910 this->buttonBrowseTraceFolder->Name = L
"buttonBrowseTraceFolder";
911 this->buttonBrowseTraceFolder->Size = System::Drawing::Size(29, 23);
912 this->buttonBrowseTraceFolder->TabIndex = 14;
913 this->buttonBrowseTraceFolder->Text = L
"...";
914 this->buttonBrowseTraceFolder->UseVisualStyleBackColor =
true;
915 this->buttonBrowseTraceFolder->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonBrowseTraceFolder_Click);
919 this->textBoxTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
920 | System::Windows::Forms::AnchorStyles::Right));
921 this->textBoxTraceFolder->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
922 static_cast<System::Byte
>(0)));
923 this->textBoxTraceFolder->Location = System::Drawing::Point(450, 30);
924 this->textBoxTraceFolder->Name = L
"textBoxTraceFolder";
925 this->textBoxTraceFolder->Size = System::Drawing::Size(342, 22);
926 this->textBoxTraceFolder->TabIndex = 13;
927 this->textBoxTraceFolder->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxTraceFolder_TextChanged);
931 this->label9->AutoSize =
true;
932 this->label9->Location = System::Drawing::Point(429, 33);
933 this->label9->Name = L
"label9";
934 this->label9->Size = System::Drawing::Size(15, 13);
935 this->label9->TabIndex = 12;
936 this->label9->Text = L
"in";
940 this->comboBoxTraceLevel->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
941 this->comboBoxTraceLevel->FormattingEnabled =
true;
942 this->comboBoxTraceLevel->Location = System::Drawing::Point(90, 31);
943 this->comboBoxTraceLevel->Name = L
"comboBoxTraceLevel";
944 this->comboBoxTraceLevel->Size = System::Drawing::Size(69, 21);
945 this->comboBoxTraceLevel->TabIndex = 11;
946 this->comboBoxTraceLevel->SelectedIndexChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxTraceLevel_SelectedIndexChanged);
947 this->comboBoxTraceLevel->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxTraceLevel_SelectedValueChanged);
951 this->label8->AutoSize =
true;
952 this->label8->Location = System::Drawing::Point(-3, 34);
953 this->label8->Name = L
"label8";
954 this->label8->Size = System::Drawing::Size(83, 13);
955 this->label8->TabIndex = 10;
956 this->label8->Text = L
"TraceFile: Level";
960 this->label6->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
961 | System::Windows::Forms::AnchorStyles::Right));
962 this->label6->BackColor = System::Drawing::SystemColors::ControlDark;
963 this->label6->Location = System::Drawing::Point(-3, 27);
964 this->label6->Name = L
"label6";
965 this->label6->Size = System::Drawing::Size(1332, 1);
966 this->label6->TabIndex = 9;
970 this->buttonReload->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
971 this->buttonReload->Enabled =
false;
972 this->buttonReload->Location = System::Drawing::Point(833, 1);
973 this->buttonReload->Name = L
"buttonReload";
974 this->buttonReload->Size = System::Drawing::Size(49, 23);
975 this->buttonReload->TabIndex = 3;
976 this->buttonReload->Text = L
"Reload";
977 this->buttonReload->UseVisualStyleBackColor =
true;
978 this->buttonReload->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonReload_Click);
982 this->txtPassword->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
983 this->txtPassword->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
984 static_cast<System::Byte
>(0)));
985 this->txtPassword->Location = System::Drawing::Point(943, 2);
986 this->txtPassword->Name = L
"txtPassword";
987 this->txtPassword->PasswordChar =
'*';
988 this->txtPassword->Size = System::Drawing::Size(93, 22);
989 this->txtPassword->TabIndex = 5;
990 this->txtPassword->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::txtPassword_TextChanged);
994 this->passwordLabel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
995 this->passwordLabel->AutoSize =
true;
996 this->passwordLabel->Location = System::Drawing::Point(884, 6);
997 this->passwordLabel->Name = L
"passwordLabel";
998 this->passwordLabel->Size = System::Drawing::Size(53, 13);
999 this->passwordLabel->TabIndex = 4;
1000 this->passwordLabel->Text = L
"Password";
1004 this->buttonBrowseFile->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1005 this->buttonBrowseFile->Location = System::Drawing::Point(798, 1);
1006 this->buttonBrowseFile->Name = L
"buttonBrowseFile";
1007 this->buttonBrowseFile->Size = System::Drawing::Size(29, 23);
1008 this->buttonBrowseFile->TabIndex = 2;
1009 this->buttonBrowseFile->Text = L
"...";
1010 this->buttonBrowseFile->UseVisualStyleBackColor =
true;
1011 this->buttonBrowseFile->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonBrowseFile_Click);
1015 this->cbFilePath->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
1016 | System::Windows::Forms::AnchorStyles::Right));
1017 this->cbFilePath->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1018 static_cast<System::Byte
>(0)));
1019 this->cbFilePath->Location = System::Drawing::Point(90, 1);
1020 this->cbFilePath->Name = L
"cbFilePath";
1021 this->cbFilePath->Size = System::Drawing::Size(702, 22);
1022 this->cbFilePath->TabIndex = 1;
1023 this->cbFilePath->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::cbFilePath_SelectedValueChanged);
1024 this->cbFilePath->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::cbFilePath_TextChanged);
1028 this->label1->AutoSize =
true;
1029 this->label1->Location = System::Drawing::Point(-3, 6);
1030 this->label1->Name = L
"label1";
1031 this->label1->Size = System::Drawing::Size(87, 13);
1032 this->label1->TabIndex = 0;
1033 this->label1->Text = L
"Select PTX/PPX";
1037 this->textBoxTimeout->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
1038 this->textBoxTimeout->Location = System::Drawing::Point(642, 3);
1039 this->textBoxTimeout->Name = L
"textBoxTimeout";
1040 this->textBoxTimeout->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
1041 this->textBoxTimeout->Size = System::Drawing::Size(45, 22);
1042 this->textBoxTimeout->TabIndex = 4;
1043 this->textBoxTimeout->Text = L
"0";
1044 this->textBoxTimeout->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxTimeout_TextChanged);
1048 this->labelTimeout->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1049 this->labelTimeout->AutoSize =
true;
1050 this->labelTimeout->Location = System::Drawing::Point(591, 0);
1051 this->labelTimeout->Name = L
"labelTimeout";
1052 this->labelTimeout->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
1053 this->labelTimeout->Size = System::Drawing::Size(45, 20);
1054 this->labelTimeout->TabIndex = 3;
1055 this->labelTimeout->Text = L
"Timeout";
1059 this->textBoxVoltageThreshold->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1060 static_cast<System::Byte
>(0)));
1061 this->textBoxVoltageThreshold->Location = System::Drawing::Point(1301, 3);
1062 this->textBoxVoltageThreshold->Name = L
"textBoxVoltageThreshold";
1063 this->textBoxVoltageThreshold->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
1064 this->textBoxVoltageThreshold->Size = System::Drawing::Size(45, 22);
1065 this->textBoxVoltageThreshold->TabIndex = 16;
1066 this->textBoxVoltageThreshold->Text = L
"6000";
1067 this->textBoxVoltageThreshold->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxBatteryVoltageThreshold_TextChanged);
1071 this->labelVoltageThreshold->AutoSize =
true;
1072 this->labelVoltageThreshold->Location = System::Drawing::Point(1205, 0);
1073 this->labelVoltageThreshold->Name = L
"labelVoltageThreshold";
1074 this->labelVoltageThreshold->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
1075 this->labelVoltageThreshold->Size = System::Drawing::Size(90, 20);
1076 this->labelVoltageThreshold->TabIndex = 15;
1077 this->labelVoltageThreshold->Text = L
"VoltageThreshold";
1081 this->textBoxPollingTime->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1082 static_cast<System::Byte
>(0)));
1083 this->textBoxPollingTime->Location = System::Drawing::Point(1159, 3);
1084 this->textBoxPollingTime->Name = L
"textBoxPollingTime";
1085 this->textBoxPollingTime->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
1086 this->textBoxPollingTime->Size = System::Drawing::Size(40, 22);
1087 this->textBoxPollingTime->TabIndex = 14;
1088 this->textBoxPollingTime->Text = L
"500";
1089 this->textBoxPollingTime->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPollingTime_TextChanged);
1093 this->labelPollingTime->AutoSize =
true;
1094 this->labelPollingTime->Location = System::Drawing::Point(1092, 0);
1095 this->labelPollingTime->Name = L
"labelPollingTime";
1096 this->labelPollingTime->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
1097 this->labelPollingTime->Size = System::Drawing::Size(61, 20);
1098 this->labelPollingTime->TabIndex = 13;
1099 this->labelPollingTime->Text = L
"PollingTime";
1103 this->checkBoxIgnition->AutoSize =
true;
1104 this->checkBoxIgnition->Checked =
true;
1105 this->checkBoxIgnition->CheckState = System::Windows::Forms::CheckState::Indeterminate;
1106 this->checkBoxIgnition->Location = System::Drawing::Point(978, 3);
1107 this->checkBoxIgnition->Name = L
"checkBoxIgnition";
1108 this->checkBoxIgnition->Padding = System::Windows::Forms::Padding(0, 3, 0, 0);
1109 this->checkBoxIgnition->Size = System::Drawing::Size(45, 20);
1110 this->checkBoxIgnition->TabIndex = 10;
1111 this->checkBoxIgnition->Text = L
"IGN";
1112 this->checkBoxIgnition->TextImageRelation = System::Windows::Forms::TextImageRelation::TextBeforeImage;
1113 this->checkBoxIgnition->ThreeState =
true;
1114 this->checkBoxIgnition->UseVisualStyleBackColor =
true;
1115 this->checkBoxIgnition->CheckStateChanged +=
gcnew System::EventHandler(
this, &SampleForm::CheckBoxKL15_CheckStateChanged);
1119 this->checkBoxUseConnectionState->AutoSize =
true;
1120 this->checkBoxUseConnectionState->CheckAlign = System::Drawing::ContentAlignment::MiddleRight;
1121 this->checkBoxUseConnectionState->Location = System::Drawing::Point(700, 3);
1122 this->checkBoxUseConnectionState->Name = L
"checkBoxUseConnectionState";
1123 this->checkBoxUseConnectionState->Padding = System::Windows::Forms::Padding(0, 3, 0, 0);
1124 this->checkBoxUseConnectionState->Size = System::Drawing::Size(139, 20);
1125 this->checkBoxUseConnectionState->TabIndex = 6;
1126 this->checkBoxUseConnectionState->Text = L
"Check ConnectionState";
1127 this->checkBoxUseConnectionState->UseVisualStyleBackColor =
true;
1128 this->checkBoxUseConnectionState->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxUseConnectionState_CheckedChanged);
1132 this->panel2->Controls->Add(this->buttonLicense);
1133 this->panel2->Controls->Add(this->buttonStartStopWebServer);
1134 this->panel2->Controls->Add(this->buttonHmi);
1135 this->panel2->Controls->Add(this->checkBoxNewRuntimeManager);
1136 this->panel2->Controls->Add(this->label15);
1137 this->panel2->Controls->Add(this->label14);
1138 this->panel2->Controls->Add(this->checkBoxCyclicReload);
1139 this->panel2->Controls->Add(this->listBoxOuput);
1140 this->panel2->Controls->Add(this->labelOutputOverflow);
1141 this->panel2->Controls->Add(this->buttonCopyRow);
1142 this->panel2->Controls->Add(this->buttonClearOutput);
1143 this->panel2->Controls->Add(this->buttonNewInstanceNewThread);
1144 this->panel2->Controls->Add(this->buttonNewInstance);
1145 this->panel2->Controls->Add(this->checkBoxStartAllParents);
1146 this->panel2->Controls->Add(this->checkBoxAdd2Output);
1147 this->panel2->Controls->Add(this->checkBoxCyclicExecution);
1148 this->panel2->Controls->Add(this->checkBoxAsyncExecution);
1149 this->panel2->Controls->Add(this->buttonPause);
1150 this->panel2->Controls->Add(this->buttonStop);
1151 this->panel2->Controls->Add(this->buttonExecuteMain);
1152 this->panel2->Controls->Add(this->buttonExecuteSelectedProcedure);
1153 this->panel2->Dock = System::Windows::Forms::DockStyle::Fill;
1154 this->panel2->Location = System::Drawing::Point(0, 0);
1155 this->panel2->Name = L
"panel2";
1156 this->panel2->Size = System::Drawing::Size(1328, 305);
1157 this->panel2->TabIndex = 0;
1161 this->buttonLicense->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1162 this->buttonLicense->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonLicense.Image")));
1163 this->buttonLicense->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1164 this->buttonLicense->Location = System::Drawing::Point(798, 5);
1165 this->buttonLicense->Name = L
"buttonLicense";
1166 this->buttonLicense->Padding = System::Windows::Forms::Padding(10, 0, 5, 0);
1167 this->buttonLicense->Size = System::Drawing::Size(91, 35);
1168 this->buttonLicense->TabIndex = 19;
1169 this->buttonLicense->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/3333D311.htm";
1170 this->buttonLicense->Text = L
"License";
1171 this->buttonLicense->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1172 this->buttonLicense->UseVisualStyleBackColor =
true;
1173 this->buttonLicense->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonLicense_Click);
1177 this->buttonStartStopWebServer->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1178 this->buttonStartStopWebServer->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonStartStopWebServer.Image")));
1179 this->buttonStartStopWebServer->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1180 this->buttonStartStopWebServer->Location = System::Drawing::Point(676, 5);
1181 this->buttonStartStopWebServer->Name = L
"buttonStartStopWebServer";
1182 this->buttonStartStopWebServer->Padding = System::Windows::Forms::Padding(10, 0, 5, 0);
1183 this->buttonStartStopWebServer->Size = System::Drawing::Size(116, 35);
1184 this->buttonStartStopWebServer->TabIndex = 18;
1185 this->buttonStartStopWebServer->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/3333D311.htm";
1186 this->buttonStartStopWebServer->Text = L
"Web Server";
1187 this->buttonStartStopWebServer->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1188 this->buttonStartStopWebServer->UseVisualStyleBackColor =
true;
1189 this->buttonStartStopWebServer->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonStartStopWebServer_Click);
1193 this->buttonHmi->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1194 this->buttonHmi->Appearance = System::Windows::Forms::Appearance::Button;
1195 this->buttonHmi->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonHmi.Image")));
1196 this->buttonHmi->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1197 this->buttonHmi->Location = System::Drawing::Point(895, 5);
1198 this->buttonHmi->Name = L
"buttonHmi";
1199 this->buttonHmi->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1200 this->buttonHmi->Size = System::Drawing::Size(80, 35);
1201 this->buttonHmi->TabIndex = 9;
1202 this->buttonHmi->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/18FE2C39.htm";
1203 this->buttonHmi->Text = L
"HMI";
1204 this->buttonHmi->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1205 this->buttonHmi->UseVisualStyleBackColor =
true;
1206 this->buttonHmi->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::buttonHmi_Click);
1210 this->checkBoxNewRuntimeManager->AutoSize =
true;
1211 this->checkBoxNewRuntimeManager->Enabled =
false;
1212 this->checkBoxNewRuntimeManager->Location = System::Drawing::Point(481, 7);
1213 this->checkBoxNewRuntimeManager->Name = L
"checkBoxNewRuntimeManager";
1214 this->checkBoxNewRuntimeManager->Size = System::Drawing::Size(89, 17);
1215 this->checkBoxNewRuntimeManager->TabIndex = 7;
1216 this->checkBoxNewRuntimeManager->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/A42F362A.htm";
1217 this->checkBoxNewRuntimeManager->Text = L
"New RntMgr.";
1218 this->checkBoxNewRuntimeManager->UseVisualStyleBackColor =
true;
1219 this->checkBoxNewRuntimeManager->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxNewRuntimeManager_CheckedChanged);
1223 this->label15->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
1224 | System::Windows::Forms::AnchorStyles::Right));
1225 this->label15->BackColor = System::Drawing::SystemColors::ControlDark;
1226 this->label15->Location = System::Drawing::Point(3, 43);
1227 this->label15->Name = L
"label15";
1228 this->label15->Size = System::Drawing::Size(1328, 1);
1229 this->label15->TabIndex = 12;
1233 this->label14->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
1234 | System::Windows::Forms::AnchorStyles::Right));
1235 this->label14->BackColor = System::Drawing::SystemColors::ControlDark;
1236 this->label14->Location = System::Drawing::Point(1, 1);
1237 this->label14->Name = L
"label14";
1238 this->label14->Size = System::Drawing::Size(1328, 1);
1239 this->label14->TabIndex = 0;
1243 this->checkBoxCyclicReload->AutoSize =
true;
1244 this->checkBoxCyclicReload->Enabled =
false;
1245 this->checkBoxCyclicReload->Location = System::Drawing::Point(481, 23);
1246 this->checkBoxCyclicReload->Name = L
"checkBoxCyclicReload";
1247 this->checkBoxCyclicReload->Size = System::Drawing::Size(91, 17);
1248 this->checkBoxCyclicReload->TabIndex = 8;
1249 this->checkBoxCyclicReload->Text = L
"Cyclic Reload";
1250 this->checkBoxCyclicReload->UseVisualStyleBackColor =
true;
1251 this->checkBoxCyclicReload->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxCyclicReload_CheckedChanged);
1255 this->listBoxOuput->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
1256 | System::Windows::Forms::AnchorStyles::Left)
1257 | System::Windows::Forms::AnchorStyles::Right));
1258 this->listBoxOuput->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1259 static_cast<System::Byte
>(0)));
1260 this->listBoxOuput->HorizontalScrollbar =
true;
1261 this->listBoxOuput->IntegralHeight =
false;
1262 this->listBoxOuput->ItemHeight = 14;
1263 this->listBoxOuput->Location = System::Drawing::Point(0, 76);
1264 this->listBoxOuput->Name = L
"listBoxOuput";
1265 this->listBoxOuput->SelectionMode = System::Windows::Forms::SelectionMode::MultiExtended;
1266 this->listBoxOuput->Size = System::Drawing::Size(1328, 81);
1267 this->listBoxOuput->TabIndex = 17;
1268 this->listBoxOuput->SelectedIndexChanged +=
gcnew System::EventHandler(
this, &SampleForm::listBoxOuput_SelectedIndexChanged);
1272 this->labelOutputOverflow->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1273 this->labelOutputOverflow->AutoSize =
true;
1274 this->labelOutputOverflow->ForeColor = System::Drawing::Color::DarkRed;
1275 this->labelOutputOverflow->Location = System::Drawing::Point(781, 53);
1276 this->labelOutputOverflow->Name = L
"labelOutputOverflow";
1277 this->labelOutputOverflow->Size = System::Drawing::Size(345, 13);
1278 this->labelOutputOverflow->TabIndex = 14;
1279 this->labelOutputOverflow->Text = L
"More than 7,500 lines are in output! After 10,000 all lines will be cleared!";
1280 this->labelOutputOverflow->Visible =
false;
1284 this->buttonCopyRow->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1285 this->buttonCopyRow->Enabled =
false;
1286 this->buttonCopyRow->Location = System::Drawing::Point(1132, 48);
1287 this->buttonCopyRow->Name = L
"buttonCopyRow";
1288 this->buttonCopyRow->Size = System::Drawing::Size(86, 23);
1289 this->buttonCopyRow->TabIndex = 15;
1290 this->buttonCopyRow->Text = L
"Copy";
1291 this->buttonCopyRow->UseVisualStyleBackColor =
true;
1292 this->buttonCopyRow->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonCopyRow_Click);
1296 this->buttonClearOutput->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1297 this->buttonClearOutput->Location = System::Drawing::Point(1224, 48);
1298 this->buttonClearOutput->Name = L
"buttonClearOutput";
1299 this->buttonClearOutput->Size = System::Drawing::Size(104, 23);
1300 this->buttonClearOutput->TabIndex = 16;
1301 this->buttonClearOutput->Text = L
"Clear Output";
1302 this->buttonClearOutput->UseVisualStyleBackColor =
true;
1303 this->buttonClearOutput->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonClearOutput_Click);
1307 this->buttonNewInstanceNewThread->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1308 this->buttonNewInstanceNewThread->AutoSize =
true;
1309 this->buttonNewInstanceNewThread->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonNewInstanceNewThread.Image")));
1310 this->buttonNewInstanceNewThread->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1311 this->buttonNewInstanceNewThread->Location = System::Drawing::Point(1116, 5);
1312 this->buttonNewInstanceNewThread->Name = L
"buttonNewInstanceNewThread";
1313 this->buttonNewInstanceNewThread->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1314 this->buttonNewInstanceNewThread->Size = System::Drawing::Size(212, 35);
1315 this->buttonNewInstanceNewThread->TabIndex = 11;
1316 this->buttonNewInstanceNewThread->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/18FE2C39.htm";
1317 this->buttonNewInstanceNewThread->Text = L
"New Instance - New Thread";
1318 this->buttonNewInstanceNewThread->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1319 this->buttonNewInstanceNewThread->UseVisualStyleBackColor =
true;
1320 this->buttonNewInstanceNewThread->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonNewInstanceNewThread_Click);
1324 this->buttonNewInstance->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1325 this->buttonNewInstance->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonNewInstance.Image")));
1326 this->buttonNewInstance->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1327 this->buttonNewInstance->Location = System::Drawing::Point(981, 5);
1328 this->buttonNewInstance->Name = L
"buttonNewInstance";
1329 this->buttonNewInstance->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1330 this->buttonNewInstance->Size = System::Drawing::Size(129, 35);
1331 this->buttonNewInstance->TabIndex = 10;
1332 this->buttonNewInstance->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/18FE2C39.htm";
1333 this->buttonNewInstance->Text = L
"New Instance";
1334 this->buttonNewInstance->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1335 this->buttonNewInstance->UseVisualStyleBackColor =
true;
1336 this->buttonNewInstance->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonNewInstance_Click);
1340 this->checkBoxStartAllParents->AutoSize =
true;
1341 this->checkBoxStartAllParents->Location = System::Drawing::Point(149, 51);
1342 this->checkBoxStartAllParents->Name = L
"checkBoxStartAllParents";
1343 this->checkBoxStartAllParents->Size = System::Drawing::Size(106, 17);
1344 this->checkBoxStartAllParents->TabIndex = 12;
1345 this->checkBoxStartAllParents->Tag = L
"";
1346 this->checkBoxStartAllParents->Text = L
"Sync with Parent";
1347 this->checkBoxStartAllParents->UseVisualStyleBackColor =
true;
1348 this->checkBoxStartAllParents->Visible =
false;
1352 this->checkBoxAdd2Output->AutoSize =
true;
1353 this->checkBoxAdd2Output->Checked =
true;
1354 this->checkBoxAdd2Output->CheckState = System::Windows::Forms::CheckState::Checked;
1355 this->checkBoxAdd2Output->Location = System::Drawing::Point(0, 51);
1356 this->checkBoxAdd2Output->Name = L
"checkBoxAdd2Output";
1357 this->checkBoxAdd2Output->Size = System::Drawing::Size(143, 17);
1358 this->checkBoxAdd2Output->TabIndex = 13;
1359 this->checkBoxAdd2Output->Tag = L
"";
1360 this->checkBoxAdd2Output->Text = L
"Add Messages to Output";
1361 this->checkBoxAdd2Output->UseVisualStyleBackColor =
true;
1362 this->checkBoxAdd2Output->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxAdd2Output_CheckedChanged);
1366 this->checkBoxCyclicExecution->AutoSize =
true;
1367 this->checkBoxCyclicExecution->Location = System::Drawing::Point(405, 23);
1368 this->checkBoxCyclicExecution->Name = L
"checkBoxCyclicExecution";
1369 this->checkBoxCyclicExecution->Size = System::Drawing::Size(54, 17);
1370 this->checkBoxCyclicExecution->TabIndex = 6;
1371 this->checkBoxCyclicExecution->Tag = L
"";
1372 this->checkBoxCyclicExecution->Text = L
"Cyclic";
1373 this->checkBoxCyclicExecution->UseVisualStyleBackColor =
true;
1374 this->checkBoxCyclicExecution->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxCyclicExecution_CheckedChanged);
1378 this->checkBoxAsyncExecution->AutoSize =
true;
1379 this->checkBoxAsyncExecution->Checked =
true;
1380 this->checkBoxAsyncExecution->CheckState = System::Windows::Forms::CheckState::Checked;
1381 this->checkBoxAsyncExecution->Location = System::Drawing::Point(405, 7);
1382 this->checkBoxAsyncExecution->Name = L
"checkBoxAsyncExecution";
1383 this->checkBoxAsyncExecution->Size = System::Drawing::Size(76, 17);
1384 this->checkBoxAsyncExecution->TabIndex = 5;
1385 this->checkBoxAsyncExecution->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/A42F362A.htm";
1386 this->checkBoxAsyncExecution->Text = L
"Asynchron";
1387 this->checkBoxAsyncExecution->UseVisualStyleBackColor =
true;
1388 this->checkBoxAsyncExecution->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxAsyncExecution_CheckedChanged);
1392 this->buttonPause->Appearance = System::Windows::Forms::Appearance::Button;
1393 this->buttonPause->Enabled =
false;
1394 this->buttonPause->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonPause.Image")));
1395 this->buttonPause->Location = System::Drawing::Point(263, 5);
1396 this->buttonPause->Name = L
"buttonPause";
1397 this->buttonPause->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1398 this->buttonPause->Size = System::Drawing::Size(42, 35);
1399 this->buttonPause->TabIndex = 3;
1400 this->buttonPause->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/3333D311.htm";
1401 this->buttonPause->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1402 this->buttonPause->UseVisualStyleBackColor =
true;
1403 this->buttonPause->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::buttonPause_Click);
1407 this->buttonStop->Enabled =
false;
1408 this->buttonStop->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonStop.Image")));
1409 this->buttonStop->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1410 this->buttonStop->Location = System::Drawing::Point(311, 5);
1411 this->buttonStop->Name = L
"buttonStop";
1412 this->buttonStop->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1413 this->buttonStop->Size = System::Drawing::Size(88, 35);
1414 this->buttonStop->TabIndex = 4;
1415 this->buttonStop->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/3333D311.htm";
1416 this->buttonStop->Text = L
"Stop";
1417 this->buttonStop->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1418 this->buttonStop->UseVisualStyleBackColor =
true;
1419 this->buttonStop->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonStop_Click);
1423 this->buttonExecuteMain->Enabled =
false;
1424 this->buttonExecuteMain->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonExecuteMain.Image")));
1425 this->buttonExecuteMain->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1426 this->buttonExecuteMain->Location = System::Drawing::Point(0, 5);
1427 this->buttonExecuteMain->Name = L
"buttonExecuteMain";
1428 this->buttonExecuteMain->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1429 this->buttonExecuteMain->Size = System::Drawing::Size(91, 35);
1430 this->buttonExecuteMain->TabIndex = 1;
1431 this->buttonExecuteMain->Text = L
"Main";
1432 this->buttonExecuteMain->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1433 this->buttonExecuteMain->UseVisualStyleBackColor =
true;
1434 this->buttonExecuteMain->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonExecuteMain_Click);
1438 this->buttonExecuteSelectedProcedure->Enabled =
false;
1439 this->buttonExecuteSelectedProcedure->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonExecuteSelectedProcedure.Image")));
1440 this->buttonExecuteSelectedProcedure->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1441 this->buttonExecuteSelectedProcedure->Location = System::Drawing::Point(97, 5);
1442 this->buttonExecuteSelectedProcedure->Name = L
"buttonExecuteSelectedProcedure";
1443 this->buttonExecuteSelectedProcedure->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1444 this->buttonExecuteSelectedProcedure->Size = System::Drawing::Size(160, 35);
1445 this->buttonExecuteSelectedProcedure->TabIndex = 2;
1446 this->buttonExecuteSelectedProcedure->Text = L
"Selected Procedure";
1447 this->buttonExecuteSelectedProcedure->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1448 this->buttonExecuteSelectedProcedure->UseVisualStyleBackColor =
true;
1449 this->buttonExecuteSelectedProcedure->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonExecuteSelectedProcedure_Click);
1453 this->openFileDialog1->Filter = L
"All supported formats(*.ptx, *.ppx)|*.ptx;*.ppx|PTX Files(*.ptx)|*.ptx|PPX Files("
1454 L
"*->ppx)|*->ppx|All Files (*->*)|*->*";
1455 this->openFileDialog1->Title = L
"Please select a PTX/PPX file";
1459 this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
1460 this->splitContainer1->FixedPanel = System::Windows::Forms::FixedPanel::Panel1;
1461 this->splitContainer1->Location = System::Drawing::Point(0, 115);
1462 this->splitContainer1->Name = L
"splitContainer1";
1466 this->splitContainer1->Panel1->Controls->Add(this->treeViewOtxProject);
1467 this->splitContainer1->Panel1->Controls->Add(this->label3);
1471 this->splitContainer1->Panel2->Controls->Add(this->splitContainer5);
1472 this->splitContainer1->Size = System::Drawing::Size(1328, 290);
1473 this->splitContainer1->SplitterDistance = 307;
1474 this->splitContainer1->TabIndex = 5;
1478 this->treeViewOtxProject->Dock = System::Windows::Forms::DockStyle::Fill;
1479 this->treeViewOtxProject->Enabled =
false;
1480 this->treeViewOtxProject->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
1481 this->treeViewOtxProject->HideSelection =
false;
1482 this->treeViewOtxProject->Location = System::Drawing::Point(0, 16);
1483 this->treeViewOtxProject->Name = L
"treeViewOtxProject";
1484 this->treeViewOtxProject->Size = System::Drawing::Size(307, 274);
1485 this->treeViewOtxProject->TabIndex = 1;
1486 this->treeViewOtxProject->DrawNode +=
gcnew System::Windows::Forms::DrawTreeNodeEventHandler(
this, &SampleForm::treeViewOtxProject_DrawNode);
1487 this->treeViewOtxProject->AfterSelect +=
gcnew System::Windows::Forms::TreeViewEventHandler(
this, &SampleForm::treeViewOtxProject_AfterSelect);
1491 this->label3->AutoSize =
true;
1492 this->label3->Dock = System::Windows::Forms::DockStyle::Top;
1493 this->label3->Location = System::Drawing::Point(0, 0);
1494 this->label3->Name = L
"label3";
1495 this->label3->Padding = System::Windows::Forms::Padding(0, 0, 0, 3);
1496 this->label3->Size = System::Drawing::Size(245, 16);
1497 this->label3->TabIndex = 0;
1498 this->label3->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/671A83F2.htm";
1499 this->label3->Text = L
"OTX-Project Tree (To execute select a Procedure)";
1503 this->splitContainer5->Dock = System::Windows::Forms::DockStyle::Fill;
1504 this->splitContainer5->FixedPanel = System::Windows::Forms::FixedPanel::Panel1;
1505 this->splitContainer5->Location = System::Drawing::Point(0, 0);
1506 this->splitContainer5->MinimumSize = System::Drawing::Size(0, 318);
1507 this->splitContainer5->Name = L
"splitContainer5";
1511 this->splitContainer5->Panel1->Controls->Add(this->splitContainer2);
1515 this->splitContainer5->Panel2->Controls->Add(this->panel3);
1516 this->splitContainer5->Panel2->Controls->Add(this->groupBox1);
1517 this->splitContainer5->Size = System::Drawing::Size(1017, 318);
1518 this->splitContainer5->SplitterDistance = 311;
1519 this->splitContainer5->TabIndex = 4;
1523 this->splitContainer2->Dock = System::Windows::Forms::DockStyle::Fill;
1524 this->splitContainer2->Location = System::Drawing::Point(0, 0);
1525 this->splitContainer2->Name = L
"splitContainer2";
1526 this->splitContainer2->Orientation = System::Windows::Forms::Orientation::Horizontal;
1530 this->splitContainer2->Panel1->Controls->Add(this->gridViewParameter);
1531 this->splitContainer2->Panel1->Controls->Add(this->labelAdjustProcedureParameters);
1535 this->splitContainer2->Panel2->Controls->Add(this->splitContainer3);
1536 this->splitContainer2->Size = System::Drawing::Size(311, 318);
1537 this->splitContainer2->SplitterDistance = 95;
1538 this->splitContainer2->TabIndex = 3;
1542 this->gridViewParameter->AllowUserToAddRows =
false;
1543 this->gridViewParameter->AllowUserToDeleteRows =
false;
1544 this->gridViewParameter->AllowUserToResizeRows =
false;
1545 this->gridViewParameter->BackgroundColor = System::Drawing::SystemColors::Window;
1546 this->gridViewParameter->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
1547 this->gridViewParameter->CellBorderStyle = System::Windows::Forms::DataGridViewCellBorderStyle::None;
1548 this->gridViewParameter->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
1549 this->gridViewParameter->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
1550 this->gridViewParameter->Columns->AddRange(
gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(5) {
1551 this->dataGridViewTextBoxColumnName,
1552 this->dataGridViewTextBoxColumnDirection, this->dataGridViewTextBoxColumnDataType, this->dataGridViewTextBoxColumnValue, this->dataGridViewTextBoxColumnDetails
1554 dataGridViewCellStyle1->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
1555 dataGridViewCellStyle1->BackColor = System::Drawing::SystemColors::Window;
1556 dataGridViewCellStyle1->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1557 static_cast<System::Byte
>(0)));
1558 dataGridViewCellStyle1->ForeColor = System::Drawing::SystemColors::ControlText;
1559 dataGridViewCellStyle1->SelectionBackColor = System::Drawing::SystemColors::Highlight;
1560 dataGridViewCellStyle1->SelectionForeColor = System::Drawing::SystemColors::HighlightText;
1561 dataGridViewCellStyle1->WrapMode = System::Windows::Forms::DataGridViewTriState::False;
1562 this->gridViewParameter->DefaultCellStyle = dataGridViewCellStyle1;
1563 this->gridViewParameter->Dock = System::Windows::Forms::DockStyle::Fill;
1564 this->gridViewParameter->Enabled =
false;
1565 this->gridViewParameter->EnableHeadersVisualStyles =
false;
1566 this->gridViewParameter->Location = System::Drawing::Point(0, 16);
1567 this->gridViewParameter->MultiSelect =
false;
1568 this->gridViewParameter->Name = L
"gridViewParameter";
1569 this->gridViewParameter->RowHeadersVisible =
false;
1570 this->gridViewParameter->RowHeadersWidth = 51;
1571 this->gridViewParameter->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
1572 this->gridViewParameter->Size = System::Drawing::Size(311, 79);
1573 this->gridViewParameter->StandardTab =
true;
1574 this->gridViewParameter->TabIndex = 1;
1575 this->gridViewParameter->CellContentClick +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridView_CellContentClick);
1576 this->gridViewParameter->CellValidated +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridViewParameter_CellValidated);
1577 this->gridViewParameter->CellValidating +=
gcnew System::Windows::Forms::DataGridViewCellValidatingEventHandler(
this, &SampleForm::gridViewParameter_CellValidating);
1578 this->gridViewParameter->CellValueChanged +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridView_CellValueChanged);
1582 this->dataGridViewTextBoxColumnName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1583 this->dataGridViewTextBoxColumnName->HeaderText = L
"Name";
1584 this->dataGridViewTextBoxColumnName->MinimumWidth = 6;
1585 this->dataGridViewTextBoxColumnName->Name = L
"dataGridViewTextBoxColumnName";
1586 this->dataGridViewTextBoxColumnName->ReadOnly =
true;
1587 this->dataGridViewTextBoxColumnName->Width = 58;
1591 this->dataGridViewTextBoxColumnDirection->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1592 this->dataGridViewTextBoxColumnDirection->HeaderText = L
"Direction";
1593 this->dataGridViewTextBoxColumnDirection->Name = L
"dataGridViewTextBoxColumnDirection";
1594 this->dataGridViewTextBoxColumnDirection->ReadOnly =
true;
1595 this->dataGridViewTextBoxColumnDirection->Width = 72;
1599 this->dataGridViewTextBoxColumnDataType->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1600 this->dataGridViewTextBoxColumnDataType->HeaderText = L
"DataType";
1601 this->dataGridViewTextBoxColumnDataType->MinimumWidth = 6;
1602 this->dataGridViewTextBoxColumnDataType->Name = L
"dataGridViewTextBoxColumnDataType";
1603 this->dataGridViewTextBoxColumnDataType->ReadOnly =
true;
1604 this->dataGridViewTextBoxColumnDataType->Width = 77;
1608 this->dataGridViewTextBoxColumnValue->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1609 this->dataGridViewTextBoxColumnValue->HeaderText = L
"Value";
1610 this->dataGridViewTextBoxColumnValue->MinimumWidth = 80;
1611 this->dataGridViewTextBoxColumnValue->Name = L
"dataGridViewTextBoxColumnValue";
1612 this->dataGridViewTextBoxColumnValue->Width = 80;
1616 this->dataGridViewTextBoxColumnDetails->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1617 this->dataGridViewTextBoxColumnDetails->HeaderText = L
"Details";
1618 this->dataGridViewTextBoxColumnDetails->Name = L
"dataGridViewTextBoxColumnDetails";
1619 this->dataGridViewTextBoxColumnDetails->ReadOnly =
true;
1620 this->dataGridViewTextBoxColumnDetails->Width = 62;
1624 this->labelAdjustProcedureParameters->AutoSize =
true;
1625 this->labelAdjustProcedureParameters->Dock = System::Windows::Forms::DockStyle::Top;
1626 this->labelAdjustProcedureParameters->Location = System::Drawing::Point(0, 0);
1627 this->labelAdjustProcedureParameters->Name = L
"labelAdjustProcedureParameters";
1628 this->labelAdjustProcedureParameters->Padding = System::Windows::Forms::Padding(0, 0, 0, 3);
1629 this->labelAdjustProcedureParameters->Size = System::Drawing::Size(188, 16);
1630 this->labelAdjustProcedureParameters->TabIndex = 0;
1631 this->labelAdjustProcedureParameters->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/94D3A64.htm";
1632 this->labelAdjustProcedureParameters->Text = L
"Parameters of the selected Procedure:";
1636 this->splitContainer3->Dock = System::Windows::Forms::DockStyle::Fill;
1637 this->splitContainer3->Location = System::Drawing::Point(0, 0);
1638 this->splitContainer3->Name = L
"splitContainer3";
1639 this->splitContainer3->Orientation = System::Windows::Forms::Orientation::Horizontal;
1643 this->splitContainer3->Panel1->Controls->Add(this->gridViewContext);
1644 this->splitContainer3->Panel1->Controls->Add(this->label4);
1648 this->splitContainer3->Panel2->Controls->Add(this->gridViewState);
1649 this->splitContainer3->Panel2->Controls->Add(this->label5);
1650 this->splitContainer3->Size = System::Drawing::Size(311, 219);
1651 this->splitContainer3->SplitterDistance = 105;
1652 this->splitContainer3->TabIndex = 0;
1656 this->gridViewContext->AllowUserToAddRows =
false;
1657 this->gridViewContext->AllowUserToDeleteRows =
false;
1658 this->gridViewContext->AllowUserToResizeRows =
false;
1659 this->gridViewContext->BackgroundColor = System::Drawing::SystemColors::Window;
1660 this->gridViewContext->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
1661 this->gridViewContext->CellBorderStyle = System::Windows::Forms::DataGridViewCellBorderStyle::None;
1662 this->gridViewContext->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
1663 this->gridViewContext->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
1664 this->gridViewContext->Columns->AddRange(
gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(4) {
1665 this->dataGridViewTextBoxColumnContextName,
1666 this->dataGridViewTextBoxColumnContextDataType, this->dataGridViewTextBoxColumnContextValue, this->dataGridViewTextBoxColumnContextDetails
1668 dataGridViewCellStyle2->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
1669 dataGridViewCellStyle2->BackColor = System::Drawing::SystemColors::Window;
1670 dataGridViewCellStyle2->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
1671 dataGridViewCellStyle2->ForeColor = System::Drawing::SystemColors::ControlText;
1672 dataGridViewCellStyle2->SelectionBackColor = System::Drawing::SystemColors::Highlight;
1673 dataGridViewCellStyle2->SelectionForeColor = System::Drawing::SystemColors::HighlightText;
1674 dataGridViewCellStyle2->WrapMode = System::Windows::Forms::DataGridViewTriState::False;
1675 this->gridViewContext->DefaultCellStyle = dataGridViewCellStyle2;
1676 this->gridViewContext->Dock = System::Windows::Forms::DockStyle::Fill;
1677 this->gridViewContext->EnableHeadersVisualStyles =
false;
1678 this->gridViewContext->Location = System::Drawing::Point(0, 16);
1679 this->gridViewContext->MultiSelect =
false;
1680 this->gridViewContext->Name = L
"gridViewContext";
1681 this->gridViewContext->RowHeadersVisible =
false;
1682 this->gridViewContext->RowHeadersWidth = 51;
1683 this->gridViewContext->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
1684 this->gridViewContext->Size = System::Drawing::Size(311, 89);
1685 this->gridViewContext->StandardTab =
true;
1686 this->gridViewContext->TabIndex = 1;
1687 this->gridViewContext->CellContentClick +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridView_CellContentClick);
1688 this->gridViewContext->CellValidated +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridViewContextVariable_CellValidated);
1689 this->gridViewContext->CellValidating +=
gcnew System::Windows::Forms::DataGridViewCellValidatingEventHandler(
this, &SampleForm::gridViewContextVariable_CellValidating);
1690 this->gridViewContext->CellValueChanged +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridView_CellValueChanged);
1694 this->dataGridViewTextBoxColumnContextName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1695 this->dataGridViewTextBoxColumnContextName->HeaderText = L
"Name";
1696 this->dataGridViewTextBoxColumnContextName->MinimumWidth = 6;
1697 this->dataGridViewTextBoxColumnContextName->Name = L
"dataGridViewTextBoxColumnContextName";
1698 this->dataGridViewTextBoxColumnContextName->ReadOnly =
true;
1699 this->dataGridViewTextBoxColumnContextName->Width = 58;
1703 this->dataGridViewTextBoxColumnContextDataType->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1704 this->dataGridViewTextBoxColumnContextDataType->HeaderText = L
"DataType";
1705 this->dataGridViewTextBoxColumnContextDataType->MinimumWidth = 6;
1706 this->dataGridViewTextBoxColumnContextDataType->Name = L
"dataGridViewTextBoxColumnContextDataType";
1707 this->dataGridViewTextBoxColumnContextDataType->ReadOnly =
true;
1708 this->dataGridViewTextBoxColumnContextDataType->Width = 77;
1712 this->dataGridViewTextBoxColumnContextValue->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1713 this->dataGridViewTextBoxColumnContextValue->HeaderText = L
"Value";
1714 this->dataGridViewTextBoxColumnContextValue->MinimumWidth = 80;
1715 this->dataGridViewTextBoxColumnContextValue->Name = L
"dataGridViewTextBoxColumnContextValue";
1716 this->dataGridViewTextBoxColumnContextValue->Width = 80;
1720 this->dataGridViewTextBoxColumnContextDetails->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1721 this->dataGridViewTextBoxColumnContextDetails->HeaderText = L
"Details";
1722 this->dataGridViewTextBoxColumnContextDetails->Name = L
"dataGridViewTextBoxColumnContextDetails";
1723 this->dataGridViewTextBoxColumnContextDetails->Width = 62;
1727 this->label4->AutoSize =
true;
1728 this->label4->Dock = System::Windows::Forms::DockStyle::Top;
1729 this->label4->Location = System::Drawing::Point(0, 0);
1730 this->label4->Name = L
"label4";
1731 this->label4->Padding = System::Windows::Forms::Padding(0, 0, 0, 3);
1732 this->label4->Size = System::Drawing::Size(277, 16);
1733 this->label4->TabIndex = 0;
1734 this->label4->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/A926ED83.htm";
1735 this->label4->Text = L
"Set value for ContextVariables of the selected Document:";
1739 this->gridViewState->AllowUserToAddRows =
false;
1740 this->gridViewState->AllowUserToDeleteRows =
false;
1741 this->gridViewState->AllowUserToResizeRows =
false;
1742 this->gridViewState->BackgroundColor = System::Drawing::SystemColors::Window;
1743 this->gridViewState->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
1744 this->gridViewState->CellBorderStyle = System::Windows::Forms::DataGridViewCellBorderStyle::None;
1745 this->gridViewState->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
1746 this->gridViewState->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
1747 this->gridViewState->Columns->AddRange(
gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(4) {
1748 this->dataGridViewTextBoxColumnStateName,
1749 this->dataGridViewTextBoxColumnStateDataType, this->dataGridViewTextBoxColumnStateValue, this->dataGridViewTextBoxColumnStateDetails
1751 dataGridViewCellStyle3->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
1752 dataGridViewCellStyle3->BackColor = System::Drawing::SystemColors::Window;
1753 dataGridViewCellStyle3->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
1754 dataGridViewCellStyle3->ForeColor = System::Drawing::SystemColors::ControlText;
1755 dataGridViewCellStyle3->SelectionBackColor = System::Drawing::SystemColors::Highlight;
1756 dataGridViewCellStyle3->SelectionForeColor = System::Drawing::SystemColors::HighlightText;
1757 dataGridViewCellStyle3->WrapMode = System::Windows::Forms::DataGridViewTriState::False;
1758 this->gridViewState->DefaultCellStyle = dataGridViewCellStyle3;
1759 this->gridViewState->Dock = System::Windows::Forms::DockStyle::Fill;
1760 this->gridViewState->EnableHeadersVisualStyles =
false;
1761 this->gridViewState->Location = System::Drawing::Point(0, 16);
1762 this->gridViewState->MultiSelect =
false;
1763 this->gridViewState->Name = L
"gridViewState";
1764 this->gridViewState->RowHeadersVisible =
false;
1765 this->gridViewState->RowHeadersWidth = 51;
1766 this->gridViewState->Size = System::Drawing::Size(311, 94);
1767 this->gridViewState->StandardTab =
true;
1768 this->gridViewState->TabIndex = 1;
1772 this->dataGridViewTextBoxColumnStateName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::DisplayedCells;
1773 this->dataGridViewTextBoxColumnStateName->HeaderText = L
"Name";
1774 this->dataGridViewTextBoxColumnStateName->MinimumWidth = 6;
1775 this->dataGridViewTextBoxColumnStateName->Name = L
"dataGridViewTextBoxColumnStateName";
1776 this->dataGridViewTextBoxColumnStateName->ReadOnly =
true;
1777 this->dataGridViewTextBoxColumnStateName->Width = 58;
1781 this->dataGridViewTextBoxColumnStateDataType->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1782 this->dataGridViewTextBoxColumnStateDataType->HeaderText = L
"DataType";
1783 this->dataGridViewTextBoxColumnStateDataType->MinimumWidth = 6;
1784 this->dataGridViewTextBoxColumnStateDataType->Name = L
"dataGridViewTextBoxColumnStateDataType";
1785 this->dataGridViewTextBoxColumnStateDataType->ReadOnly =
true;
1786 this->dataGridViewTextBoxColumnStateDataType->Width = 77;
1790 this->dataGridViewTextBoxColumnStateValue->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1791 this->dataGridViewTextBoxColumnStateValue->HeaderText = L
"Value";
1792 this->dataGridViewTextBoxColumnStateValue->MinimumWidth = 80;
1793 this->dataGridViewTextBoxColumnStateValue->Name = L
"dataGridViewTextBoxColumnStateValue";
1794 this->dataGridViewTextBoxColumnStateValue->ReadOnly =
true;
1795 this->dataGridViewTextBoxColumnStateValue->Width = 80;
1799 this->dataGridViewTextBoxColumnStateDetails->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1800 this->dataGridViewTextBoxColumnStateDetails->HeaderText = L
"Details";
1801 this->dataGridViewTextBoxColumnStateDetails->Name = L
"dataGridViewTextBoxColumnStateDetails";
1802 this->dataGridViewTextBoxColumnStateDetails->ReadOnly =
true;
1803 this->dataGridViewTextBoxColumnStateDetails->Width = 62;
1807 this->label5->AutoSize =
true;
1808 this->label5->Dock = System::Windows::Forms::DockStyle::Top;
1809 this->label5->Location = System::Drawing::Point(0, 0);
1810 this->label5->Name = L
"label5";
1811 this->label5->Padding = System::Windows::Forms::Padding(0, 0, 0, 3);
1812 this->label5->Size = System::Drawing::Size(248, 16);
1813 this->label5->TabIndex = 0;
1814 this->label5->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/94D3A64.htm";
1815 this->label5->Text = L
"Display Status Variables of the selected Document:";
1819 this->panel3->Controls->Add(this->gridViewSettings);
1820 this->panel3->Controls->Add(this->panel4);
1821 this->panel3->Dock = System::Windows::Forms::DockStyle::Fill;
1822 this->panel3->Location = System::Drawing::Point(0, 46);
1823 this->panel3->Name = L
"panel3";
1824 this->panel3->Size = System::Drawing::Size(702, 272);
1825 this->panel3->TabIndex = 1;
1829 this->gridViewSettings->AllowUserToAddRows =
false;
1830 this->gridViewSettings->AllowUserToDeleteRows =
false;
1831 this->gridViewSettings->AllowUserToResizeRows =
false;
1832 this->gridViewSettings->BackgroundColor = System::Drawing::SystemColors::Window;
1833 this->gridViewSettings->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
1834 this->gridViewSettings->CellBorderStyle = System::Windows::Forms::DataGridViewCellBorderStyle::None;
1835 this->gridViewSettings->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
1836 this->gridViewSettings->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
1837 this->gridViewSettings->Columns->AddRange(
gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(2) {
1838 this->dataGridViewTextBoxColumnSettingName,
1839 this->dataGridViewTextBoxColumnSettingValue
1841 this->gridViewSettings->Dock = System::Windows::Forms::DockStyle::Fill;
1842 this->gridViewSettings->Location = System::Drawing::Point(0, 28);
1843 this->gridViewSettings->MultiSelect =
false;
1844 this->gridViewSettings->Name = L
"gridViewSettings";
1845 this->gridViewSettings->RowHeadersVisible =
false;
1846 this->gridViewSettings->RowHeadersWidth = 51;
1847 this->gridViewSettings->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
1848 this->gridViewSettings->Size = System::Drawing::Size(702, 244);
1849 this->gridViewSettings->StandardTab =
true;
1850 this->gridViewSettings->TabIndex = 1;
1854 this->dataGridViewTextBoxColumnSettingName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::Fill;
1855 this->dataGridViewTextBoxColumnSettingName->HeaderText = L
"Name";
1856 this->dataGridViewTextBoxColumnSettingName->MinimumWidth = 100;
1857 this->dataGridViewTextBoxColumnSettingName->Name = L
"dataGridViewTextBoxColumnSettingName";
1858 this->dataGridViewTextBoxColumnSettingName->ReadOnly =
true;
1862 this->dataGridViewTextBoxColumnSettingValue->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::Fill;
1863 this->dataGridViewTextBoxColumnSettingValue->HeaderText = L
"Value";
1864 this->dataGridViewTextBoxColumnSettingValue->MinimumWidth = 160;
1865 this->dataGridViewTextBoxColumnSettingValue->Name = L
"dataGridViewTextBoxColumnSettingValue";
1869 this->panel4->Controls->Add(this->label12);
1870 this->panel4->Controls->Add(this->buttonWriteSettings);
1871 this->panel4->Controls->Add(this->buttonReadSettings);
1872 this->panel4->Dock = System::Windows::Forms::DockStyle::Top;
1873 this->panel4->Location = System::Drawing::Point(0, 0);
1874 this->panel4->Name = L
"panel4";
1875 this->panel4->Padding = System::Windows::Forms::Padding(20, 0, 20, 0);
1876 this->panel4->Size = System::Drawing::Size(702, 28);
1877 this->panel4->TabIndex = 0;
1881 this->label12->AutoSize =
true;
1882 this->label12->Location = System::Drawing::Point(2, 8);
1883 this->label12->Name = L
"label12";
1884 this->label12->Padding = System::Windows::Forms::Padding(0, 3, 0, 3);
1885 this->label12->Size = System::Drawing::Size(81, 19);
1886 this->label12->TabIndex = 0;
1887 this->label12->Text = L
"Project Settings";
1891 this->buttonWriteSettings->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1892 this->buttonWriteSettings->Location = System::Drawing::Point(652, 3);
1893 this->buttonWriteSettings->Name = L
"buttonWriteSettings";
1894 this->buttonWriteSettings->Size = System::Drawing::Size(50, 23);
1895 this->buttonWriteSettings->TabIndex = 2;
1896 this->buttonWriteSettings->Text = L
"Write";
1897 this->buttonWriteSettings->UseVisualStyleBackColor =
true;
1898 this->buttonWriteSettings->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonWriteSettings_Click);
1902 this->buttonReadSettings->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1903 this->buttonReadSettings->Location = System::Drawing::Point(598, 3);
1904 this->buttonReadSettings->Name = L
"buttonReadSettings";
1905 this->buttonReadSettings->Size = System::Drawing::Size(50, 23);
1906 this->buttonReadSettings->TabIndex = 1;
1907 this->buttonReadSettings->Text = L
"Read";
1908 this->buttonReadSettings->UseVisualStyleBackColor =
true;
1909 this->buttonReadSettings->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonReadSettings_Click);
1913 this->groupBox1->Controls->Add(this->radioButtonNoCustomImplementation);
1914 this->groupBox1->Controls->Add(this->radioButtonDefaultImplementation);
1915 this->groupBox1->Controls->Add(this->radioButtonOuputWindow);
1916 this->groupBox1->Dock = System::Windows::Forms::DockStyle::Top;
1917 this->groupBox1->Location = System::Drawing::Point(0, 0);
1918 this->groupBox1->MinimumSize = System::Drawing::Size(166, 0);
1919 this->groupBox1->Name = L
"groupBox1";
1920 this->groupBox1->Size = System::Drawing::Size(702, 46);
1921 this->groupBox1->TabIndex = 0;
1922 this->groupBox1->TabStop =
false;
1923 this->groupBox1->Text = L
"Select Custom Implementation";
1927 this->radioButtonNoCustomImplementation->AutoSize =
true;
1928 this->radioButtonNoCustomImplementation->Location = System::Drawing::Point(250, 19);
1929 this->radioButtonNoCustomImplementation->Name = L
"radioButtonNoCustomImplementation";
1930 this->radioButtonNoCustomImplementation->Size = System::Drawing::Size(51, 17);
1931 this->radioButtonNoCustomImplementation->TabIndex = 2;
1932 this->radioButtonNoCustomImplementation->TabStop =
true;
1933 this->radioButtonNoCustomImplementation->Text = L
"None";
1934 this->radioButtonNoCustomImplementation->UseVisualStyleBackColor =
true;
1935 this->radioButtonNoCustomImplementation->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::radioButtonCustomImpl_CheckedChanged);
1939 this->radioButtonDefaultImplementation->AutoSize =
true;
1940 this->radioButtonDefaultImplementation->Location = System::Drawing::Point(6, 19);
1941 this->radioButtonDefaultImplementation->Name = L
"radioButtonDefaultImplementation";
1942 this->radioButtonDefaultImplementation->Size = System::Drawing::Size(133, 17);
1943 this->radioButtonDefaultImplementation->TabIndex = 0;
1944 this->radioButtonDefaultImplementation->TabStop =
true;
1945 this->radioButtonDefaultImplementation->Text = L
"Default Implementation";
1946 this->radioButtonDefaultImplementation->UseVisualStyleBackColor =
true;
1947 this->radioButtonDefaultImplementation->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::radioButtonCustomImpl_CheckedChanged);
1951 this->radioButtonOuputWindow->AutoSize =
true;
1952 this->radioButtonOuputWindow->Location = System::Drawing::Point(145, 19);
1953 this->radioButtonOuputWindow->Name = L
"radioButtonOuputWindow";
1954 this->radioButtonOuputWindow->Size = System::Drawing::Size(99, 17);
1955 this->radioButtonOuputWindow->TabIndex = 1;
1956 this->radioButtonOuputWindow->TabStop =
true;
1957 this->radioButtonOuputWindow->Text = L
"Output Window";
1958 this->radioButtonOuputWindow->UseVisualStyleBackColor =
true;
1959 this->radioButtonOuputWindow->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::radioButtonCustomImpl_CheckedChanged);
1963 this->splitContainer4->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
1964 | System::Windows::Forms::AnchorStyles::Left)
1965 | System::Windows::Forms::AnchorStyles::Right));
1966 this->splitContainer4->FixedPanel = System::Windows::Forms::FixedPanel::Panel1;
1967 this->splitContainer4->Location = System::Drawing::Point(12, 12);
1968 this->splitContainer4->Name = L
"splitContainer4";
1969 this->splitContainer4->Orientation = System::Windows::Forms::Orientation::Horizontal;
1973 this->splitContainer4->Panel1->Controls->Add(this->splitContainer1);
1974 this->splitContainer4->Panel1->Controls->Add(this->panel1);
1978 this->splitContainer4->Panel2->Controls->Add(this->panel2);
1979 this->splitContainer4->Size = System::Drawing::Size(1328, 714);
1980 this->splitContainer4->SplitterDistance = 405;
1981 this->splitContainer4->TabIndex = 9;
1985 this->folderBrowserDialog1->Description = L
"Browse for folder...";
1989 this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L
"imageList1.ImageStream")));
1990 this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
1991 this->imageList1->Images->SetKeyName(0, L
"ODFProject.bmp");
1992 this->imageList1->Images->SetKeyName(1, L
"Package.bmp");
1993 this->imageList1->Images->SetKeyName(2, L
"DocumentOTX16.bmp");
1994 this->imageList1->Images->SetKeyName(3, L
"Procedure.bmp");
1998 this->labelSeparator2->BackColor = System::Drawing::SystemColors::ControlDark;
1999 this->labelSeparator2->Location = System::Drawing::Point(693, 5);
2000 this->labelSeparator2->Margin = System::Windows::Forms::Padding(3, 5, 3, 0);
2001 this->labelSeparator2->Name = L
"labelSeparator2";
2002 this->labelSeparator2->Size = System::Drawing::Size(1, 16);
2003 this->labelSeparator2->TabIndex = 5;
2007 this->labelProcedureExecutionState->AutoEllipsis =
true;
2008 this->labelProcedureExecutionState->Dock = System::Windows::Forms::DockStyle::Fill;
2009 this->labelProcedureExecutionState->Location = System::Drawing::Point(22, 0);
2010 this->labelProcedureExecutionState->Margin = System::Windows::Forms::Padding(0, 0, 3, 0);
2011 this->labelProcedureExecutionState->Name = L
"labelProcedureExecutionState";
2012 this->labelProcedureExecutionState->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
2013 this->labelProcedureExecutionState->Size = System::Drawing::Size(385, 31);
2014 this->labelProcedureExecutionState->TabIndex = 1;
2015 this->labelProcedureExecutionState->Text = L
"Select a procedure and click \"Start\"...";
2019 this->tableLayoutPanelExecutionState->ColumnCount = 23;
2020 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2021 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent,
2023 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2024 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2025 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2026 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2027 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2028 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2029 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2030 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2031 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2032 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2033 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2034 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2035 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2036 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2037 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2038 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2039 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2040 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2041 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2042 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2043 this->tableLayoutPanelExecutionState->ColumnStyles->Add((
gcnew System::Windows::Forms::ColumnStyle()));
2044 this->tableLayoutPanelExecutionState->Controls->Add(this->labelIconProcedureExecutionState, 0, 0);
2045 this->tableLayoutPanelExecutionState->Controls->Add(this->labelProcedureExecutionState, 1, 0);
2046 this->tableLayoutPanelExecutionState->Controls->Add(this->labelSeparator2, 7, 0);
2047 this->tableLayoutPanelExecutionState->Controls->Add(this->checkBoxUseConnectionState, 8, 0);
2048 this->tableLayoutPanelExecutionState->Controls->Add(this->labelBatteryState, 11, 0);
2049 this->tableLayoutPanelExecutionState->Controls->Add(this->checkBoxIgnition, 12, 0);
2050 this->tableLayoutPanelExecutionState->Controls->Add(this->labelExpectedState, 10, 0);
2051 this->tableLayoutPanelExecutionState->Controls->Add(this->labelSeparator3, 9, 0);
2052 this->tableLayoutPanelExecutionState->Controls->Add(this->textBoxVoltageThreshold, 19, 0);
2053 this->tableLayoutPanelExecutionState->Controls->Add(this->labelVoltageThreshold, 18, 0);
2054 this->tableLayoutPanelExecutionState->Controls->Add(this->textBoxPollingTime, 17, 0);
2055 this->tableLayoutPanelExecutionState->Controls->Add(this->labelPollingTime, 16, 0);
2056 this->tableLayoutPanelExecutionState->Controls->Add(this->labelSeparator4, 15, 0);
2057 this->tableLayoutPanelExecutionState->Controls->Add(this->labelSeparator1, 2, 0);
2058 this->tableLayoutPanelExecutionState->Controls->Add(this->labelTimeout, 5, 0);
2059 this->tableLayoutPanelExecutionState->Controls->Add(this->textBoxTimeout, 6, 0);
2060 this->tableLayoutPanelExecutionState->Controls->Add(this->buttonCheckBatteryIgnition, 14, 0);
2061 this->tableLayoutPanelExecutionState->Controls->Add(this->labelIgnitionState, 13, 0);
2062 this->tableLayoutPanelExecutionState->Controls->Add(this->labelSeparator5, 4, 0);
2063 this->tableLayoutPanelExecutionState->Controls->Add(this->labelProcedureExecutionTimes, 3, 0);
2064 this->tableLayoutPanelExecutionState->Dock = System::Windows::Forms::DockStyle::Bottom;
2065 this->tableLayoutPanelExecutionState->Location = System::Drawing::Point(0, 593);
2066 this->tableLayoutPanelExecutionState->Name = L
"tableLayoutPanelExecutionState";
2067 this->tableLayoutPanelExecutionState->Padding = System::Windows::Forms::Padding(0, 0, 3, 0);
2068 this->tableLayoutPanelExecutionState->RowCount = 1;
2069 this->tableLayoutPanelExecutionState->RowStyles->Add((
gcnew System::Windows::Forms::RowStyle()));
2070 this->tableLayoutPanelExecutionState->Size = System::Drawing::Size(1352, 28);
2071 this->tableLayoutPanelExecutionState->TabIndex = 10;
2075 this->labelIconProcedureExecutionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"labelIconProcedureExecutionState.Image")));
2076 this->labelIconProcedureExecutionState->Location = System::Drawing::Point(4, 0);
2077 this->labelIconProcedureExecutionState->Margin = System::Windows::Forms::Padding(4, 0, 0, 0);
2078 this->labelIconProcedureExecutionState->Name = L
"labelIconProcedureExecutionState";
2079 this->labelIconProcedureExecutionState->Padding = System::Windows::Forms::Padding(0, 6, 0, 0);
2080 this->labelIconProcedureExecutionState->Size = System::Drawing::Size(18, 22);
2081 this->labelIconProcedureExecutionState->TabIndex = 0;
2082 this->labelIconProcedureExecutionState->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;
2086 this->labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"labelBatteryState.Image")));
2087 this->labelBatteryState->ImageAlign = System::Drawing::ContentAlignment::MiddleRight;
2088 this->labelBatteryState->Location = System::Drawing::Point(952, 0);
2089 this->labelBatteryState->Name = L
"labelBatteryState";
2090 this->labelBatteryState->Padding = System::Windows::Forms::Padding(0, 4, 0, 0);
2091 this->labelBatteryState->Size = System::Drawing::Size(20, 23);
2092 this->labelBatteryState->TabIndex = 9;
2096 this->labelExpectedState->AutoSize =
true;
2097 this->labelExpectedState->Location = System::Drawing::Point(852, 0);
2098 this->labelExpectedState->Name = L
"labelExpectedState";
2099 this->labelExpectedState->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
2100 this->labelExpectedState->Size = System::Drawing::Size(94, 20);
2101 this->labelExpectedState->TabIndex = 8;
2102 this->labelExpectedState->Text = L
"Expected: BAT on";
2106 this->labelSeparator3->BackColor = System::Drawing::SystemColors::ControlDark;
2107 this->labelSeparator3->Location = System::Drawing::Point(845, 5);
2108 this->labelSeparator3->Margin = System::Windows::Forms::Padding(3, 5, 3, 0);
2109 this->labelSeparator3->Name = L
"labelSeparator3";
2110 this->labelSeparator3->Size = System::Drawing::Size(1, 16);
2111 this->labelSeparator3->TabIndex = 7;
2115 this->labelSeparator4->BackColor = System::Drawing::SystemColors::ControlDark;
2116 this->labelSeparator4->Location = System::Drawing::Point(1085, 5);
2117 this->labelSeparator4->Margin = System::Windows::Forms::Padding(3, 5, 3, 0);
2118 this->labelSeparator4->Name = L
"labelSeparator4";
2119 this->labelSeparator4->Size = System::Drawing::Size(1, 16);
2120 this->labelSeparator4->TabIndex = 12;
2124 this->labelSeparator1->BackColor = System::Drawing::SystemColors::ControlDark;
2125 this->labelSeparator1->Location = System::Drawing::Point(413, 5);
2126 this->labelSeparator1->Margin = System::Windows::Forms::Padding(3, 5, 3, 0);
2127 this->labelSeparator1->Name = L
"labelSeparator1";
2128 this->labelSeparator1->Size = System::Drawing::Size(1, 16);
2129 this->labelSeparator1->TabIndex = 2;
2130 this->labelSeparator1->Visible =
false;
2134 this->buttonCheckBatteryIgnition->Location = System::Drawing::Point(1055, 3);
2135 this->buttonCheckBatteryIgnition->Name = L
"buttonCheckBatteryIgnition";
2136 this->buttonCheckBatteryIgnition->Size = System::Drawing::Size(24, 20);
2137 this->buttonCheckBatteryIgnition->TabIndex = 11;
2138 this->buttonCheckBatteryIgnition->Text = L
"...";
2139 this->buttonCheckBatteryIgnition->UseVisualStyleBackColor =
true;
2140 this->buttonCheckBatteryIgnition->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonCheckBatteryIgnition_Click);
2144 this->labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"labelIgnitionState.Image")));
2145 this->labelIgnitionState->ImageAlign = System::Drawing::ContentAlignment::MiddleRight;
2146 this->labelIgnitionState->Location = System::Drawing::Point(1029, 0);
2147 this->labelIgnitionState->Name = L
"labelIgnitionState";
2148 this->labelIgnitionState->Padding = System::Windows::Forms::Padding(0, 4, 0, 0);
2149 this->labelIgnitionState->Size = System::Drawing::Size(20, 23);
2150 this->labelIgnitionState->TabIndex = 9;
2154 this->labelSeparator5->BackColor = System::Drawing::SystemColors::ControlDark;
2155 this->labelSeparator5->Location = System::Drawing::Point(584, 5);
2156 this->labelSeparator5->Margin = System::Windows::Forms::Padding(3, 5, 3, 0);
2157 this->labelSeparator5->Name = L
"labelSeparator5";
2158 this->labelSeparator5->Size = System::Drawing::Size(1, 16);
2159 this->labelSeparator5->TabIndex = 5;
2163 this->labelProcedureExecutionTimes->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
2164 this->labelProcedureExecutionTimes->AutoSize =
true;
2165 this->labelProcedureExecutionTimes->Location = System::Drawing::Point(420, 0);
2166 this->labelProcedureExecutionTimes->Name = L
"labelProcedureExecutionTimes";
2167 this->labelProcedureExecutionTimes->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
2168 this->labelProcedureExecutionTimes->Size = System::Drawing::Size(158, 20);
2169 this->labelProcedureExecutionTimes->TabIndex = 3;
2170 this->labelProcedureExecutionTimes->Text = L
"main: 00:12 | Procedure1: 01:24";
2171 this->labelProcedureExecutionTimes->Visible =
false;
2175 this->label18->BackColor = System::Drawing::SystemColors::ControlDark;
2176 this->label18->Dock = System::Windows::Forms::DockStyle::Bottom;
2177 this->label18->Location = System::Drawing::Point(0, 592);
2178 this->label18->Name = L
"label18";
2179 this->label18->Size = System::Drawing::Size(1352, 1);
2180 this->label18->TabIndex = 0;
2184 this->updateGuiTimer->Interval = 500;
2185 this->updateGuiTimer->Tick +=
gcnew System::EventHandler(
this, &SampleForm::updateGuiTimer_Tick);
2189 this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
2190 this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
2191 this->BackColor = System::Drawing::SystemColors::Window;
2192 this->ClientSize = System::Drawing::Size(1352, 621);
2193 this->Controls->Add(this->label18);
2194 this->Controls->Add(this->tableLayoutPanelExecutionState);
2195 this->Controls->Add(this->splitContainer4);
2196 this->DoubleBuffered =
true;
2197 this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L
"$this.Icon")));
2198 this->MinimumSize = System::Drawing::Size(1260, 660);
2199 this->Name = L
"SampleForm";
2200 this->FormClosing +=
gcnew System::Windows::Forms::FormClosingEventHandler(
this, &SampleForm::SampleForm_FormClosing);
2201 this->Load +=
gcnew System::EventHandler(
this, &SampleForm::SampleForm_Load);
2202 this->Shown +=
gcnew System::EventHandler(
this, &SampleForm::SampleForm_Shown);
2203 this->panel1->ResumeLayout(
false);
2204 this->panel1->PerformLayout();
2205 this->panel2->ResumeLayout(
false);
2206 this->panel2->PerformLayout();
2207 this->splitContainer1->Panel1->ResumeLayout(
false);
2208 this->splitContainer1->Panel1->PerformLayout();
2209 this->splitContainer1->Panel2->ResumeLayout(
false);
2210 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer1))->EndInit();
2211 this->splitContainer1->ResumeLayout(
false);
2212 this->splitContainer5->Panel1->ResumeLayout(
false);
2213 this->splitContainer5->Panel2->ResumeLayout(
false);
2214 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer5))->EndInit();
2215 this->splitContainer5->ResumeLayout(
false);
2216 this->splitContainer2->Panel1->ResumeLayout(
false);
2217 this->splitContainer2->Panel1->PerformLayout();
2218 this->splitContainer2->Panel2->ResumeLayout(
false);
2219 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer2))->EndInit();
2220 this->splitContainer2->ResumeLayout(
false);
2221 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewParameter))->EndInit();
2222 this->splitContainer3->Panel1->ResumeLayout(
false);
2223 this->splitContainer3->Panel1->PerformLayout();
2224 this->splitContainer3->Panel2->ResumeLayout(
false);
2225 this->splitContainer3->Panel2->PerformLayout();
2226 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer3))->EndInit();
2227 this->splitContainer3->ResumeLayout(
false);
2228 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewContext))->EndInit();
2229 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewState))->EndInit();
2230 this->panel3->ResumeLayout(
false);
2231 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewSettings))->EndInit();
2232 this->panel4->ResumeLayout(
false);
2233 this->panel4->PerformLayout();
2234 this->groupBox1->ResumeLayout(
false);
2235 this->groupBox1->PerformLayout();
2236 this->splitContainer4->Panel1->ResumeLayout(
false);
2237 this->splitContainer4->Panel2->ResumeLayout(
false);
2238 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer4))->EndInit();
2239 this->splitContainer4->ResumeLayout(
false);
2240 this->tableLayoutPanelExecutionState->ResumeLayout(
false);
2241 this->tableLayoutPanelExecutionState->PerformLayout();
2242 this->ResumeLayout(
false);
2246 private: System::Void textBoxTraceFileMaxSize_TextChanged(System::Object^ sender, System::EventArgs^ e);
2247 private: System::Void textBoxTraceFileMaxCount_TextChanged(System::Object^ sender, System::EventArgs^ e);
2248 private: System::Void buttonOpenTraceFolder_Click(System::Object^ sender, System::EventArgs^ e);
2249 private: System::Void textBoxRuntimeContextName_TextChanged(System::Object^ sender, System::EventArgs^ e);
2250 private: System::Void textBoxPortPipe_TextChanged(System::Object^ sender, System::EventArgs^ e);
2251 private: System::Void comboBoxIpcType_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e);
2252 private: System::Void buttonBrowseTraceFolder_Click(System::Object^ sender, System::EventArgs^ e);
2253 private: System::Void textBoxTraceFolder_TextChanged(System::Object^ sender, System::EventArgs^ e);
2254 private: System::Void comboBoxTraceLevel_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e);
2255 private: System::Void comboBoxTraceLevel_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e);
2256 private: System::Void buttonReload_Click(System::Object^ sender, System::EventArgs^ e);
2257 private: System::Void txtPassword_TextChanged(System::Object^ sender, System::EventArgs^ e);
2258 private: System::Void buttonBrowseFile_Click(System::Object^ sender, System::EventArgs^ e);
2259 private: System::Void cbFilePath_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e);
2260 private: System::Void cbFilePath_TextChanged(System::Object^ sender, System::EventArgs^ e);
2261 private: System::Void textBoxTimeout_TextChanged(System::Object^ sender, System::EventArgs^ e);
2262 private: System::Void textBoxBatteryVoltageThreshold_TextChanged(System::Object^ sender, System::EventArgs^ e);
2263 private: System::Void textBoxPollingTime_TextChanged(System::Object^ sender, System::EventArgs^ e);
2264 private: System::Void CheckBoxKL15_CheckStateChanged(System::Object^ sender, System::EventArgs^ e);
2265 private: System::Void checkBoxUseConnectionState_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2266 private: System::Void buttonLicense_Click(System::Object^ sender, System::EventArgs^ e);
2267 private: System::Void buttonStartStopWebServer_Click(System::Object^ sender, System::EventArgs^ e);
2268 private: System::Void buttonHmi_Click(System::Object^ sender, System::EventArgs^ e);
2269 private: System::Void checkBoxNewRuntimeManager_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2270 private: System::Void checkBoxCyclicReload_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2271 private: System::Void listBoxOuput_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e);
2272 private: System::Void buttonCopyRow_Click(System::Object^ sender, System::EventArgs^ e);
2273 private: System::Void buttonClearOutput_Click(System::Object^ sender, System::EventArgs^ e);
2274 private: System::Void buttonNewInstanceNewThread_Click(System::Object^ sender, System::EventArgs^ e);
2275 private: System::Void buttonNewInstance_Click(System::Object^ sender, System::EventArgs^ e);
2276 private: System::Void checkBoxAdd2Output_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2277 private: System::Void checkBoxCyclicExecution_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2278 private: System::Void checkBoxAsyncExecution_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2279 private: System::Void buttonPause_Click(System::Object^ sender, System::EventArgs^ e);
2280 private: System::Void buttonStop_Click(System::Object^ sender, System::EventArgs^ e);
2281 private: System::Void buttonExecuteMain_Click(System::Object^ sender, System::EventArgs^ e);
2282 private: System::Void buttonExecuteSelectedProcedure_Click(System::Object^ sender, System::EventArgs^ e);
2283 private: System::Void buttonWriteSettings_Click(System::Object^ sender, System::EventArgs^ e);
2284 private: System::Void buttonReadSettings_Click(System::Object^ sender, System::EventArgs^ e);
2285 private: System::Void radioButtonCustomImpl_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2286 private: System::Void buttonCheckBatteryIgnition_Click(System::Object^ sender, System::EventArgs^ e);
2287 private: System::Void treeViewOtxProject_DrawNode(System::Object^ sender, System::Windows::Forms::DrawTreeNodeEventArgs^ e);
2288 private: System::Void treeViewOtxProject_AfterSelect(System::Object^ sender, System::Windows::Forms::TreeViewEventArgs^ e);
2289 private: System::Void gridView_CellValueChanged(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e);
2290 private: System::Void gridView_CellContentClick(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e);
2291 private: System::Void gridViewParameter_CellValidated(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e);
2292 private: System::Void gridViewParameter_CellValidating(System::Object^ sender, System::Windows::Forms::DataGridViewCellValidatingEventArgs^ e);
2293 private: System::Void gridViewContextVariable_CellValidated(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e);
2294 private: System::Void gridViewContextVariable_CellValidating(System::Object^ sender, System::Windows::Forms::DataGridViewCellValidatingEventArgs^ e);
2295 private: System::Void updateGuiTimer_Tick(System::Object^ sender, System::EventArgs^ e);
2296 private: System::Void SampleForm_Load(System::Object^ sender, System::EventArgs^ e);
2297 private: System::Void SampleForm_Shown(System::Object^ sender, System::EventArgs^ e);
2298 private: System::Void SampleForm_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e);
2299 private:
void WebServerTimer_Tick(System::Object^ sender, System::EventArgs^ e);
2300 void HmiWindow_SizeChanged(System::Object^ sender, System::EventArgs^ e);
2301 void HmiWindow_Activated(System::Object^ sender, System::EventArgs^ e);
2302 private: System::Void comboBoxODXProject_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e);
2303 private: System::Void comboBoxODXVehicle_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e);
2304 private: System::Void comboBoxDiagIpcType_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e);
2305 private: System::Void checkBoxIncludedDiagLogging_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2306 private: System::Void buttonOpenDiagLoggingTraceFolder_Click(System::Object^ sender, System::EventArgs^ e);
2307 private: System::Void buttonBrowseDiagLoggingTraceFolder_Click(System::Object^ sender, System::EventArgs^ e);
2308 private: System::Void textBoxDiagManagerLicenseKey_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e);
2309 private: System::Void textBoxDiagManagerLicenseKey_TextChanged(System::Object^ sender, System::EventArgs^ e);
2310 private: System::Void comboBoxDiagManagerTraceLevel_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e);
2311 private: System::Void comboBoxDiagLoggingTraceLevel_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e);
2312 private: System::Void textBoxDiagManagerTraceFolder_TextChanged(System::Object^ sender, System::EventArgs^ e);
2313 private:
void SystemEvents_DisplaySettingsChanged(System::Object^ sender, System::EventArgs^ e);
2314 private: System::Void checkBoxProfiling_CheckedChanged(System::Object^ sender, System::EventArgs^ e);
2315 private: System::Void textBoxProfilingSize_TextChanged(System::Object^ sender, System::EventArgs^ e);
Contains information of a Runner instance.
Definition: IRuntimeContext.h:30
Namespace containing the programming interface for browsing and execution of OTX procedures in own ap...
Definition: ClampState.h:7
Namespace containing all objects related to testing inside automotive industry