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;
197 std::shared_ptr<Custom::DefaultCustomScreenImplementation> CustomScreenImplementation;
198 std::shared_ptr<Custom::ContextVariableImplementation> ContextVariableImplementation;
200 std::shared_ptr<Custom::StateVariableImplementation> StateVariableImplementation;
201 std::shared_ptr<Custom::DefaultMeasureImplementation> MeasureImplementation;
202 std::shared_ptr<Custom::DefaultExternalServiceProviderImplementation> ServiceProviderImplementation;
204 std::shared_ptr<BasicScreenOutputImpl> _BasicScreenOutputImpl;
205 std::shared_ptr<CommonDialogsOutputImpl> _CommonDialogsOutputImpl;
206 std::shared_ptr<ContextVariableOutputImpl> _ContextVariableOutputImpl;
207 std::shared_ptr<CustomScreenOutputImpl> _CustomScreenOutputImpl;
208 std::shared_ptr<ExternalServiceProviderOutputImpl> _ServiceProviderOutputImpl;
209 std::shared_ptr<I18nOutputImpl> _I18nOutputImpl;
210 std::shared_ptr<LoggingOutputImpl> _LoggingOutputImpl;
211 std::shared_ptr<MeasureOutputImpl> _MeasureOutputImpl;
212 std::shared_ptr<SqlOutputImpl> _SqlOutputImpl;
213 std::shared_ptr<StateVariableOutputImpl> _StateVariableOutputImpl;
215 const int VALUE_STRING_MAX_LENGTH = 1024;
216 const int FORM_OFFSET = 25;
217 const int DEFAULT_POLLING_TIME = 500;
218 const int DEFAULT_BATTERY_VOLTAGE_THRESHOLD = 6000;
220 void InitializeRuntimeEvents(std::shared_ptr<IRuntimeManager> runtimeManager)
222 if (runtimeManager ==
nullptr)
227 RemoveRuntimeEvents(runtimeManager);
229 _ProcedurePending = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedurePending,
this, std::placeholders::_1));
230 _ProcedureStarted = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureStarted,
this, std::placeholders::_1));
231 _ProcedurePaused = std::make_shared<std::function<void(
const IRuntimeContext&, ExecutionStateChangeReason)>>(std::bind(&SampleFormImpl::ProcedurePaused,
this, std::placeholders::_1, std::placeholders::_2));
232 _ProcedureContinued = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureContinued,
this, std::placeholders::_1));
233 _ProcedureFinished = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureFinished,
this, std::placeholders::_1));
234 _ProcedureStopped = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureStopped,
this, std::placeholders::_1));
235 _ProcedureAborted = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureAborted,
this, std::placeholders::_1));
236 _ProcedureTimeout = std::make_shared<std::function<void(
const IRuntimeContext&)>>(std::bind(&SampleFormImpl::ProcedureTimeout,
this, std::placeholders::_1));
237 _DiagConnectionStateChanged = std::make_shared<std::function<void(ClampState, ClampState)>>(std::bind(&SampleFormImpl::DiagConnectionStateChanged,
this, std::placeholders::_1, std::placeholders::_2));
238 _InOutParameterValueChanged = std::make_shared<std::function<void(
const IRuntimeContext&,
const IProcedureInOutParameter&)>>(std::bind(&SampleFormImpl::InOutParameterValueChanged,
this, std::placeholders::_1, std::placeholders::_2));
240 runtimeManager->AddProcedurePendingListener(_ProcedurePending);
241 runtimeManager->AddProcedureStartedListener(_ProcedureStarted);
242 runtimeManager->AddProcedurePausedListener(_ProcedurePaused);
243 runtimeManager->AddProcedureContinuedListener(_ProcedureContinued);
244 runtimeManager->AddProcedureFinishedListener(_ProcedureFinished);
245 runtimeManager->AddProcedureStoppedListener(_ProcedureStopped);
246 runtimeManager->AddProcedureAbortedListener(_ProcedureAborted);
247 runtimeManager->AddProcedureTimeoutListener(_ProcedureTimeout);
248 runtimeManager->AddDiagConnectionStateChangedListener(_DiagConnectionStateChanged);
249 runtimeManager->AddInOutParameterValueChangedListener(_InOutParameterValueChanged);
252 void RemoveRuntimeEvents(std::shared_ptr<IRuntimeManager> runtimeManager)
254 if (_ProcedurePending !=
nullptr)
256 runtimeManager->RemoveProcedurePendingListener(_ProcedurePending);
259 if (_ProcedureStarted !=
nullptr)
261 runtimeManager->RemoveProcedureStartedListener(_ProcedureStarted);
264 if (_ProcedurePaused !=
nullptr)
266 runtimeManager->RemoveProcedurePausedListener(_ProcedurePaused);
269 if (_ProcedureContinued !=
nullptr)
271 runtimeManager->RemoveProcedureContinuedListener(_ProcedureContinued);
274 if (_ProcedureFinished !=
nullptr)
276 runtimeManager->RemoveProcedureFinishedListener(_ProcedureFinished);
279 if (_ProcedureStopped !=
nullptr)
281 runtimeManager->RemoveProcedureStoppedListener(_ProcedureStopped);
284 if (_ProcedureAborted !=
nullptr)
286 runtimeManager->RemoveProcedureAbortedListener(_ProcedureAborted);
289 if (_ProcedureTimeout !=
nullptr)
291 runtimeManager->RemoveProcedureTimeoutListener(_ProcedureTimeout);
294 if (_DiagConnectionStateChanged !=
nullptr)
296 runtimeManager->RemoveDiagConnectionStateChangedListener(_DiagConnectionStateChanged);
299 if (_InOutParameterValueChanged !=
nullptr)
301 runtimeManager->RemoveInOutParameterValueChangedListener(_InOutParameterValueChanged);
305 void ProcedurePending(
const IRuntimeContext& context)
307 Owner->ProcedurePendingCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
310 void ProcedureStarted(
const IRuntimeContext& context)
312 Owner->ProcedureStartedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
315 void ProcedurePaused(
const IRuntimeContext& context, ExecutionStateChangeReason reason)
317 IRuntimeContext* pContext =
const_cast<IRuntimeContext*
>(&context);
318 Owner->ProcedurePaused(pContext, reason);
321 void ProcedureContinued(
const IRuntimeContext& context)
323 Owner->ProcedureContinuedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
326 void ProcedureFinished(
const IRuntimeContext& context)
328 Owner->ProcedureFinishedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
331 void ProcedureStopped(
const IRuntimeContext& context)
333 Owner->ProcedureStoppedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
336 void ProcedureAborted(
const IRuntimeContext& context)
338 Owner->ProcedureAbortedCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
341 void ProcedureTimeout(
const IRuntimeContext& context)
343 Owner->ProcedureTimeoutCallback(
gcnew CLRWrapper<IRuntimeContext*>(
const_cast<IRuntimeContext*
>(&context)));
346 void DiagConnectionStateChanged(ClampState batteryState, ClampState ignitionState)
348 Owner->DiagConnectionStateChanged(batteryState, ignitionState);
351 void InOutParameterValueChanged(
const IRuntimeContext& context,
const IProcedureInOutParameter& parameter)
353 IRuntimeContext* pContext =
const_cast<IRuntimeContext*
>(&context);
354 IProcedureInOutParameter* pParameter =
const_cast<IProcedureInOutParameter*
>(¶meter);
355 Owner->InOutParameterValueChanged(pContext, pParameter);
358 void SetDefaultCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
360 if (runtimeManager ==
nullptr)
365 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IBasicScreenImplementation>)
nullptr);
366 runtimeManager->SetCustomImplementation(CustomScreenImplementation);
367 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ILoggingImplementation>)
nullptr);
368 runtimeManager->SetCustomImplementation(ContextVariableImplementation);
370 runtimeManager->SetCustomImplementation(StateVariableImplementation);
371 runtimeManager->SetCustomImplementation(MeasureImplementation);
372 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::Ii18nImplementation>)
nullptr);
373 runtimeManager->SetCustomImplementation(ServiceProviderImplementation);
375 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ISqlImplementation>)
nullptr);
376 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ICommonDialogsImplementation>)
nullptr);
379 void RemoveCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
381 if (runtimeManager ==
nullptr)
386 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IBasicScreenImplementation>)
nullptr);
387 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ICustomScreenImplementation>)
nullptr);
388 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ICommonDialogsImplementation>)
nullptr);
389 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IContextVariableImplementation>)
nullptr);
390 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IExternalServiceProviderImplementation>)
nullptr);
391 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::Ii18nImplementation>)
nullptr);
392 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ILoggingImplementation>)
nullptr);
393 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IMeasureImplementation>)
nullptr);
394 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::ISqlImplementation>)
nullptr);
395 runtimeManager->SetCustomImplementation((std::shared_ptr<Custom::IStateVariableImplementation>)
nullptr);
398 void ClearCustomImplemetationCaches()
400 if (IS_NOT_NULL(ContextVariableImplementation))
402 ContextVariableImplementation->ResetAllValues();
405 if (IS_NOT_NULL(_ContextVariableOutputImpl))
407 _ContextVariableOutputImpl->ResetAllValues();
410 if (IS_NOT_NULL(StateVariableImplementation))
412 StateVariableImplementation->ResetAllValues();
418 void CreateDefaultCustomImpl()
420 CustomScreenImplementation = std::make_shared<Custom::DefaultCustomScreenImplementation>();
421 _KeyDown = std::make_shared<std::function<void(std::shared_ptr<Custom::KeyEventArgs>)>>(std::bind(&SampleFormImpl::CustomScreenImplementation_KeyDown,
this, std::placeholders::_1));
422 CustomScreenImplementation->AddKeyDownListener(_KeyDown);
424 ContextVariableImplementation = std::make_shared<Custom::ContextVariableImplementation>();
425 _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));
426 ContextVariableImplementation->SetContextVariableReadHandler(_ContextVariableRead);
428 StateVariableImplementation = std::make_shared<Custom::StateVariableImplementation>();
429 _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));
430 StateVariableImplementation->SetStateVariableValueChangedHandler(_StateVariableValueChanged);
432 MeasureImplementation = std::make_shared<Custom::DefaultMeasureImplementation>();
433 ServiceProviderImplementation = std::make_shared<Custom::DefaultExternalServiceProviderImplementation>();
436 void CustomScreenImplementation_KeyDown(std::shared_ptr<Custom::KeyEventArgs> eventArgs)
438 Owner->CustomScreenImplementation_KeyDown(eventArgs);
441 void ContextVariableRead(std::shared_ptr<IContextVariable> contextVariable, std::shared_ptr<DataTypes::Object> value)
443 Owner->ContextVariableRead(contextVariable, value);
446 void StateVariableValueChanged(std::shared_ptr<IStateVariable> stateVariable, std::shared_ptr<DataTypes::Object> value)
448 Owner->StateVariableValueChanged(stateVariable, value);
451 void CreateOutputWindowCustomImpl()
453 _BasicScreenOutputImpl = std::make_shared<BasicScreenOutputImpl>();
454 _CustomScreenOutputImpl = std::make_shared<CustomScreenOutputImpl>();
455 _LoggingOutputImpl = std::make_shared<LoggingOutputImpl>();
456 _ContextVariableOutputImpl = std::make_shared<ContextVariableOutputImpl>();
458 _StateVariableOutputImpl = std::make_shared<StateVariableOutputImpl>();
459 _MeasureOutputImpl = std::make_shared<MeasureOutputImpl>();
460 _I18nOutputImpl = std::make_shared<I18nOutputImpl>();
461 _ServiceProviderOutputImpl = std::make_shared<ExternalServiceProviderOutputImpl>();
463 _CommonDialogsOutputImpl = std::make_shared<CommonDialogsOutputImpl>();
464 _SqlOutputImpl = std::make_shared<SqlOutputImpl>();
466 _BasicScreenOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
467 _CustomScreenOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
468 _LoggingOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
469 _ContextVariableOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
471 _StateVariableOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
472 _MeasureOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
473 _I18nOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
474 _ServiceProviderOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
476 _CommonDialogsOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
477 _SqlOutputImpl->_logEventHandler = std::make_shared<std::function<void(
const std::string&)>>(std::bind(&SampleFormImpl::WriteLogEvent,
this, std::placeholders::_1));
480 void RemoveOutputImplLogEventHandler()
482 if(_BasicScreenOutputImpl !=
nullptr)
483 _BasicScreenOutputImpl->_logEventHandler =
nullptr;
484 if(_CustomScreenOutputImpl !=
nullptr)
485 _CustomScreenOutputImpl->_logEventHandler =
nullptr;
486 if(_CustomScreenOutputImpl !=
nullptr)
487 _LoggingOutputImpl->_logEventHandler =
nullptr;
488 if(_CustomScreenOutputImpl !=
nullptr)
489 _ContextVariableOutputImpl->_logEventHandler =
nullptr;
491 if(_CustomScreenOutputImpl !=
nullptr)
492 _StateVariableOutputImpl->_logEventHandler =
nullptr;
493 if(_CustomScreenOutputImpl !=
nullptr)
494 _MeasureOutputImpl->_logEventHandler =
nullptr;
495 if(_CustomScreenOutputImpl !=
nullptr)
496 _I18nOutputImpl->_logEventHandler =
nullptr;
497 if(_CustomScreenOutputImpl !=
nullptr)
498 _ServiceProviderOutputImpl->_logEventHandler =
nullptr;
500 if(_CustomScreenOutputImpl !=
nullptr)
501 _CommonDialogsOutputImpl->_logEventHandler =
nullptr;
502 if(_CustomScreenOutputImpl !=
nullptr)
503 _SqlOutputImpl->_logEventHandler =
nullptr;
505 _BasicScreenOutputImpl =
nullptr;
506 _CustomScreenOutputImpl =
nullptr;
507 _LoggingOutputImpl =
nullptr;
508 _ContextVariableOutputImpl =
nullptr;
510 _StateVariableOutputImpl =
nullptr;
511 _MeasureOutputImpl =
nullptr;
512 _I18nOutputImpl =
nullptr;
513 _ServiceProviderOutputImpl =
nullptr;
515 _CommonDialogsOutputImpl =
nullptr;
516 _SqlOutputImpl =
nullptr;
519 void WriteLogEvent(
const std::string& text)
521 Owner->PrintTextCallback(Util::Util::ToString(text));
524 void SetOutputWindowImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
526 if (runtimeManager ==
nullptr)
531 runtimeManager->SetCustomImplementation(_BasicScreenOutputImpl);
532 runtimeManager->SetCustomImplementation(_CommonDialogsOutputImpl);
533 runtimeManager->SetCustomImplementation(_ContextVariableOutputImpl);
534 runtimeManager->SetCustomImplementation(_CustomScreenOutputImpl);
535 runtimeManager->SetCustomImplementation(_ServiceProviderOutputImpl);
536 runtimeManager->SetCustomImplementation(_I18nOutputImpl);
537 runtimeManager->SetCustomImplementation(_LoggingOutputImpl);
538 runtimeManager->SetCustomImplementation(_MeasureOutputImpl);
539 runtimeManager->SetCustomImplementation(_SqlOutputImpl);
540 runtimeManager->SetCustomImplementation(_StateVariableOutputImpl);
544 msclr::auto_gcroot<SampleForm^> Owner;
545 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedurePending;
546 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureStarted;
547 std::shared_ptr<std::function<void(
const IRuntimeContext&, ExecutionStateChangeReason)>> _ProcedurePaused;
548 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureContinued;
549 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureFinished;
550 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureStopped;
551 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureAborted;
552 std::shared_ptr<std::function<void(
const IRuntimeContext&)>> _ProcedureTimeout;
553 std::shared_ptr<std::function<void(ClampState, ClampState)>> _DiagConnectionStateChanged;
554 std::shared_ptr<std::function<void(
const IRuntimeContext&,
const IProcedureInOutParameter&)>> _InOutParameterValueChanged;
556 std::shared_ptr<std::function<void(std::shared_ptr<Custom::KeyEventArgs>)>> _KeyDown;
557 std::shared_ptr<std::function<void(std::shared_ptr<IContextVariable>, std::shared_ptr<DataTypes::Object>)>> _ContextVariableRead;
558 std::shared_ptr<std::function<void(std::shared_ptr<IStateVariable>, std::shared_ptr<DataTypes::Object>)>> _StateVariableValueChanged;
561 bool SampleFormImpl::IsRegistered =
false;
562 std::string SampleFormImpl::FileVersion =
"";
563 std::vector<msclr::auto_gcroot<SampleForm^>> SampleFormImpl::ListForms;
565 void SampleForm::RegisterSettingsEvent()
567 if (!SampleFormImpl::IsRegistered)
569 SampleFormImpl::IsRegistered =
true;
571 SampleFormImpl::FileVersion = RuntimeConfig::GetInstance().GetVersion();
574 System::String^ licenseKeyFromOTForOTPLicense;
577 if (!System::String::IsNullOrEmpty(licenseKeyFromOTForOTPLicense) && Util::LicenseUtil::CheckLicenseFormat(Util::Util::ToString(licenseKeyFromOTForOTPLicense)))
583 std::string licenseKey = Setting::UserSettings::GetInstance().GetLicenseKey();
584 licenseKey = Util::LicenseUtil::Decrypt(licenseKey);
585 if (Util::LicenseUtil::CheckLicenseFormat(licenseKey))
591 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);
595 Microsoft::Win32::SystemEvents::DisplaySettingsChanged +=
gcnew System::EventHandler(
this, &OpenTestSystem::Otx::Runtime2::Api::Sample::SampleForm::SystemEvents_DisplaySettingsChanged);
599 void SampleForm::SystemEvents_DisplaySettingsChanged(System::Object^ sender, System::EventArgs^ e)
603 for (
int i = 0; i < SampleFormImpl::ListForms.size(); i++)
605 msclr::auto_gcroot<SampleForm^> frm = SampleFormImpl::ListForms.at(i);
608 if (frm.get()->InvokeRequired)
610 frm.get()->Invoke(
gcnew System::Action(frm.get(), &SampleForm::Refresh));
614 frm.get()->Refresh();
623 void SampleForm::InitializeInternalComponent()
625 piml =
new SampleFormImpl(
this);
626 RegisterSettingsEvent();
629 SampleForm::SampleForm(System::String^ title, SampleForm^ creatorForm)
631 ShowInTaskbar =
false;
632 InitializeInternalComponent();
634 piml->Title = System::String::IsNullOrEmpty(title) ? SampleConstants::MAIN_INSTANCE_NAME : Util::Util::ToString(title);
635 piml->CreatorForm = creatorForm;
637 piml->WebServerTimer->Interval = 1000;
638 piml->WebServerTimer->Enabled =
true;
639 piml->WebServerTimer->Tick +=
gcnew System::EventHandler(
this, &SampleForm::WebServerTimer_Tick);
641 InitializeComponent();
643 piml->ListForms.push_back(
this);
645 PrintTextCallback(
"Application started");
648 System::Void SampleForm::SampleForm_Load(System::Object^ sender, System::EventArgs^ e)
650 PrintTextCallback(
"Start Initialization...");
653 InitializeSampleDefaultValues();
654 UpdateWebServerButtonCallback();
656 if (IS_NOT_NULL(piml->CreatorForm))
658 checkBoxStartAllParents->Visible =
true;
659 checkBoxStartAllParents->Checked = piml->CreatorForm->checkBoxStartAllParents->Checked;
662 SetRuntimeContextName();
663 SetTitle(Util::Util::ToString(piml->Title));
664 SetLocation(piml->CreatorForm.get());
666 toolTip1->SetToolTip(labelProcedureExecutionTimes,
"Total procedure execution time.");
667 toolTip1->SetToolTip(textBoxTimeout,
"Timeout for procedure execution in milliseconds. The default value 0 means without timeout.");
668 toolTip1->SetToolTip(checkBoxUseConnectionState,
"Use expected connection state during procedure execution.");
669 toolTip1->SetToolTip(labelBatteryState,
"State of the battery (KL 30)");
670 toolTip1->SetToolTip(checkBoxIgnition,
"Expected ignition (KL 15) state during procedure execution");
671 toolTip1->SetToolTip(labelIgnitionState,
"State of the ignition (KL 15)");
672 toolTip1->SetToolTip(buttonCheckBatteryIgnition,
"Check current battery (KL30) and ignition (KL15) state.");
673 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.");
674 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.");
676 LoadContextFile(piml->GlobalRuntimeManager);
678 PrintTextCallback(
"... Initialization finished.");
679 ShowInTaskbar =
true;
680 #pragma region Only Cpp: See issue 15942 - bug 7
681 WindowState = System::Windows::Forms::FormWindowState::Normal;
685 System::Void SampleForm::SampleForm_Shown(System::Object^ sender, System::EventArgs^ e)
687 cbFilePath->SelectionLength = 0;
690 void SampleForm::SetRuntimeContextName()
692 if (IS_NOT_NULL(piml->CreatorForm) && !System::String::IsNullOrEmpty(Util::Util::ToString(piml->CreatorForm->piml->RuntimeContextName)))
694 System::String^ contextName = Util::Util::ToString(piml->CreatorForm->piml->RuntimeContextName);
695 System::Text::RegularExpressions::Match^ regExpMatch = System::Text::RegularExpressions::Regex::Match(contextName,
"\d*$");
697 if (System::Int32::TryParse(regExpMatch->Value, number))
700 textBoxRuntimeContextName->Text = Util::Util::ToString(piml->CreatorForm->piml->RuntimeContextName.substr(0, regExpMatch->Index) + std::to_string(number));
705 void SampleForm::SetTitle(System::String^ title)
707 if (System::String::IsNullOrWhiteSpace(title))
709 title = Util::Util::ToString(SampleConstants::MAIN_INSTANCE_NAME);
712 bool runningAsAdmin = System::Security::Principal::WindowsIdentity::GetCurrent()->Owner->IsWellKnown(System::Security::Principal::WellKnownSidType::BuiltinAdministratorsSid);
714 Text = System::String::Format(
715 "emotive OTX-Runtime API for Cpp - Reference Application - Version {0} - {1} Bit - {2} - Thread-ID {3}{4}",
716 Util::Util::ToString(piml->FileVersion),
717 System::Environment::Is64BitProcess ?
"64" :
"32",
718 Util::Util::ToString(piml->Title),
719 System::Threading::Thread::CurrentThread->ManagedThreadId,
720 runningAsAdmin ?
" - Administrator" : System::String::Empty
723 if (!System::String::IsNullOrEmpty(cbFilePath->Text))
725 Text = Text +
" - " + System::IO::Path::GetFileName(cbFilePath->Text);
728 System::String^ runtimeContextNameCliStr = Util::Util::ToString(piml->RuntimeContextName);
729 if (!System::String::IsNullOrEmpty(runtimeContextNameCliStr))
731 Text = Text +
" - " + runtimeContextNameCliStr;
735 void SampleForm::SetLocation(SampleForm^ creatorForm)
737 if (creatorForm !=
nullptr)
739 int xOffset = piml->FORM_OFFSET;
740 int yOffset = piml->FORM_OFFSET;
742 if (IS_NOT_NULL(creatorForm->piml->CreatorForm))
744 xOffset = creatorForm->Location.X - creatorForm->piml->CreatorForm->Location.X;
745 yOffset = creatorForm->Location.Y - creatorForm->piml->CreatorForm->Location.Y;
748 Location = Point(creatorForm->Location.X + xOffset, creatorForm->Location.Y + yOffset);
749 Size = creatorForm->Size;
753 void SampleForm::CreateCustomImpl()
755 CreateDefaultCustomImpl();
756 CreateOutputWindowCustomImpl();
759 void SampleForm::CreateDefaultCustomImpl()
761 PrintTextCallback(
"Create default custom implementation");
763 piml->CreateDefaultCustomImpl();
766 void SampleForm::CreateOutputWindowCustomImpl()
768 PrintTextCallback(
"Create output window custom implementation");
770 piml->CreateOutputWindowCustomImpl();
773 void SampleForm::InitializeSampleDefaultValues()
775 PrintTextCallback(
"Initialize default values");
777 comboBoxTraceLevel->Items->AddRange(Util::Util::ArrayTraceLevels2String());
780 treeViewOtxProject->ImageList = imageList1;
782 textBoxRtPortPipe->Name = Util::Util::ToString(SampleConstants::RT_PORT_PIPE_TEXT_BOX_NAME);
783 textBoxDiagPortPipe->Name = Util::Util::ToString(SampleConstants::DM_PORT_PIPE_TEXT_BOX_NAME);
787 EnableConnectionState();
790 void SampleForm::LoadSetting()
792 Setting::UserSettings::GetInstance().Reload();
797 SetupTraceFileMaxCountAndSize();
800 SetupDefaultPortAndPipeName();
802 cbFilePath->Text = Util::Util::ToString(Setting::UserSettings::GetInstance().GetPtxPpxDirectory());
803 if (!Setting::UserSettings::GetInstance().GetPtxPpxDirectoryList().empty())
805 cbFilePath->Items->AddRange(Util::Util::ToString(Setting::UserSettings::GetInstance().GetPtxPpxDirectoryList())->Split(
';'));
807 AddComboBoxFileOrPath(cbFilePath);
809 SetupCustomImplType();
811 SetupWindowLocation();
813 checkBoxAsyncExecution->Checked = Setting::UserSettings::GetInstance().GetAsynchron();
814 checkBoxCyclicExecution->Checked = Setting::UserSettings::GetInstance().GetCyclic();
815 checkBoxCyclicReload->Checked = Setting::UserSettings::GetInstance().GetCyclicReload();
816 checkBoxNewRuntimeManager->Checked = Setting::UserSettings::GetInstance().GetNewRuntimeManager();
817 checkBoxAdd2Output->Checked = Setting::UserSettings::GetInstance().GetAddMessageToOutput();
818 checkBoxStartAllParents->Checked = Setting::UserSettings::GetInstance().GetStartAllParents();
821 checkBoxUseConnectionState->Checked = Setting::UserSettings::GetInstance().GetConnectionState();
822 checkBoxIgnition->CheckState = Setting::UserSettings::GetInstance().GetIgnition() == 1 ? System::Windows::Forms::CheckState::Checked
823 : (Setting::UserSettings::GetInstance().GetIgnition() == 0 ? System::Windows::Forms::CheckState::Unchecked
824 : System::Windows::Forms::CheckState::Indeterminate);
826 SetupVoltageThreshold();
828 textBoxRuntimeContextName->Text = Util::Util::ToString(Setting::UserSettings::GetInstance().GetRuntimeContextName());
830 #pragma region C++ for RAW-Mode
831 textBoxDiagManagerLicenseKey->Text = Util::Util::ToString(Util::LicenseUtil::Decrypt(Setting::UserSettings::GetInstance().GetDiagManagerLicenseKey()));
832 checkBoxIncludedDiagLogging->Checked = Setting::UserSettings::GetInstance().GetIncludeTraceDiagLogging();
834 std::string traceFolder = Setting::UserSettings::GetInstance().GetDiagTraceDirectory();
835 textBoxDiagManagerTraceFolder->Text = Util::Util::ToString(traceFolder.empty() ? Util::OtxDiagUtil::GetPathLoggerDefault() : traceFolder);
839 catch (
const std::exception& e)
841 PrintTextCallback(Util::Util::ToString(e.what()));
842 Setting::UserSettings::GetInstance().Reset();
844 catch (System::Exception^ e)
846 PrintTextCallback(e->Message);
847 Setting::UserSettings::GetInstance().Reset();
851 void SampleForm::AddComboBoxFileOrPath(System::Windows::Forms::ComboBox^ comboBox)
853 if (comboBox !=
nullptr && !piml->IsPathChanging)
855 piml->IsPathChanging =
true;
857 System::String^ path = comboBox->Text;
859 if (System::IO::Directory::Exists(path) || System::IO::File::Exists(path))
861 while (comboBox->Items->Contains(path))
863 comboBox->Items->Remove(path);
866 while (comboBox->Items->Contains(path->TrimEnd(
gcnew cli::array<wchar_t>(2) {
'/',
'\\' })))
868 comboBox->Items->Remove(path->TrimEnd(
gcnew cli::array<wchar_t>(2) {
'/',
'\\' }));
871 path = path->TrimEnd(
gcnew cli::array<wchar_t>(2) {
'/',
'\\' });
873 comboBox->Items->Insert(0, path);
874 comboBox->Text = path;
875 comboBox->SelectAll();
878 piml->IsPathChanging =
false;
882 void SampleForm::SetupTraceFileMaxCountAndSize()
884 textBoxTraceFileMaxCount->Text = Setting::UserSettings::GetInstance().GetTraceFileMaxCount().ToString();
885 textBoxTraceFileMaxSize->Text = Setting::UserSettings::GetInstance().GetTraceFileMaxSize().ToString();
888 void SampleForm::SetupDefaultPortAndPipeName()
890 piml->DefaultDiagPort = Setting::UserSettings::GetInstance().GetDiagManagerPort();
891 piml->DefaultRuntimePort = Setting::UserSettings::GetInstance().GetRuntimePort();
893 piml->DefaultDiagPipeName = Setting::UserSettings::GetInstance().GetDiagManagerPipeName();
894 piml->DefaultRuntimePipeName = Setting::UserSettings::GetInstance().GetRuntimePipeName();
896 IpcTypes ipcType = IpcTypes::Socket;
897 ipcType = Setting::UserSettings::GetInstance().GetIpcType();
899 if (comboBoxIpcType->Items->Count == 0)
902 comboBoxIpcType->Items->AddRange(Util::Util::ArrayIpcTypes2String());
905 comboBoxIpcType->SelectedItem = Util::Util::ToString(ipcType);
908 void SampleForm::SetupTraceLevel()
910 TraceLevels traceLevels = Setting::UserSettings::GetInstance().GetTraceLevels();
914 comboBoxTraceLevel->SelectedItem = Util::Util::ToString(traceLevels);
917 void SampleForm::SetupTraceFolder()
919 if (Setting::UserSettings::GetInstance().GetTracingDirectory().empty() !=
true)
924 textBoxTraceFolder->Text = Util::Util::ToString(RuntimeConfig::GetInstance().GetTraceFolder());
927 void SampleForm::SetupCustomImplType()
929 if (Setting::UserSettings::GetInstance().GetCustomImplTypes() == CustomImplTypes::OutputImpl)
931 radioButtonOuputWindow->Checked =
true;
933 else if (Setting::UserSettings::GetInstance().GetCustomImplTypes() == CustomImplTypes::NoCustom)
935 radioButtonNoCustomImplementation->Checked =
true;
939 radioButtonDefaultImplementation->Checked =
true;
943 void SampleForm::SetupWindowSize()
945 int width = Setting::UserSettings::GetInstance().GetWindowWidth();
946 int height = Setting::UserSettings::GetInstance().GetWindowHeight();
947 Size = System::Drawing::Size(width, height);
950 void SampleForm::SetupWindowLocation()
952 int locationX = Setting::UserSettings::GetInstance().GetWindowLocationX();
953 int locationY = Setting::UserSettings::GetInstance().GetWindowLocationY();
954 System::Drawing::Point location = System::Drawing::Point(locationX, locationY);
956 if (CheckFormIsInBound(location))
965 bool SampleForm::CheckFormIsInBound(System::Drawing::Point location)
969 #pragma region C++ can not use Linq
970 cli::array<System::Windows::Forms::Screen^>^ formContainScreens = System::Windows::Forms::Screen::AllScreens;
971 for (
int i = 0; i < formContainScreens->Length; i++)
973 if (formContainScreens[i]->Bounds.Contains(location))
988 void SampleForm::SetupTimeOut()
990 System::String^ timeOutString = Setting::UserSettings::GetInstance().GetTimeOut().ToString();
991 textBoxTimeout->Text = timeOutString;
994 void SampleForm::SetupPollingTime()
996 std::string pollingTimeString = std::to_string(Setting::UserSettings::GetInstance().GetPollingTime());
997 textBoxPollingTime->Text = Util::Util::ToString(pollingTimeString);
1000 void SampleForm::SetupVoltageThreshold()
1002 std::string voltageThreshold = std::to_string(Setting::UserSettings::GetInstance().GetVoltageThreshold());
1003 textBoxVoltageThreshold->Text = Util::Util::ToString(voltageThreshold);
1006 System::Void SampleForm::comboBoxIpcType_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
1009 textBoxDiagPortPipe->TextChanged -=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
1010 IpcTypes ipcType = Util::Util::ToIpcType(comboBoxIpcType->SelectedItem->ToString());
1012 #pragma region C++ for design has RAW-mode
1014 textBoxDiagPortPipe->Hide();
1015 textBoxRtPortPipe->Hide();
1016 comboBoxODXProject->Hide();
1018 comboBoxODXVehicle->Hide();
1019 portPipeLabel->Hide();
1020 labelOdxProject->Hide();
1023 panel1->Size = System::Drawing::Size(panel1->Size.Width, 61);
1024 portPipeLabel->Location = System::Drawing::Point(portPipeLabel->Location.X, 34);
1025 textBoxDiagPortPipe->Location = System::Drawing::Point(Width - 95, 31);
1026 textBoxDiagPortPipe->Size = System::Drawing::Size(55, 22);
1031 #pragma region C++ for RAW-mode
1034 panel1->Size = System::Drawing::Size(panel1->Size.Width, 116);
1036 SetupDiagManagerControls();
1038 comboBoxDiagIpcType_SelectedValueChanged(comboBoxDiagIpcType,
nullptr);
1043 case IpcTypes::Socket:
1045 portPipeLabel->Show();
1046 portPipeLabel->Text =
"Runner / DiagManager Ports";
1048 #pragma region C++ for design has RAW-mode
1049 textBoxRtPortPipe->Show();
1051 textBoxDiagPortPipe->Show();
1054 textBoxDiagPortPipe->Text = piml->DefaultDiagPort.ToString();
1055 textBoxDiagPortPipe->TextChanged+=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
1057 textBoxRtPortPipe->Text = piml->DefaultRuntimePort.ToString();
1060 case IpcTypes::Pipe:
1062 portPipeLabel->Show();
1063 portPipeLabel->Text =
"Runner / DiagManager Pipes";
1065 #pragma region C++ for design has RAW-mode
1066 textBoxRtPortPipe->Show();
1068 textBoxDiagPortPipe->Show();
1071 textBoxDiagPortPipe->Text = Util::Util::ToString(piml->DefaultDiagPipeName);
1072 textBoxDiagPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
1074 textBoxRtPortPipe->Text = Util::Util::ToString(piml->DefaultRuntimePipeName);
1082 System::Void SampleForm::textBoxPortPipe_TextChanged(System::Object^ sender, System::EventArgs^ e)
1084 PrintTextCallback(
"Create RuntimeManager...");
1088 piml->GlobalRuntimeManager = CreateRuntimeManager();
1090 catch (
const std::exception& ex)
1093 PrintTextCallback(
"No RuntimeManager created");
1095 catch (System::Exception^ ex)
1097 System::String^ senderName = (
dynamic_cast<System::Windows::Forms::TextBox^
>(sender))->Name;
1098 if (senderName->Equals(Util::Util::ToString(SampleConstants::RT_PORT_PIPE_TEXT_BOX_NAME)))
1100 PrintTextCallback(System::String::Format(
"Invalid Otx Runtime {0}", IpcPortPipeString()));
1102 else if (senderName->Equals(Util::Util::ToString(SampleConstants::DM_PORT_PIPE_TEXT_BOX_NAME)))
1104 PrintTextCallback(System::String::Format(
"Invalid Diag Manager {0}", IpcPortPipeString()));
1108 PrintTextCallback(
"No RuntimeManager created");
1112 PrintTextCallback(
"No RuntimeManager created");
1115 if (piml->GlobalRuntimeManager==
nullptr)
1117 PrintTextCallback(
"RuntimeManager is null.");
1121 std::shared_ptr<IRuntimeManager> SampleForm::CreateRuntimeManager()
1123 std::shared_ptr<IRuntimeManager> runtimeManager =
nullptr;
1126 System::String^ ipcType =
"";
1127 switch (Util::Util::ToIpcType(comboBoxIpcType->SelectedItem->ToString()))
1129 #pragma region C++ for RAW-mode
1132 runtimeManager = CreateRawRuntimeManager();
1133 ipcType = Util::Util::ToString(IpcTypes::Raw);
1137 case IpcTypes::Socket:
1139 runtimeManager = CreateSocketRuntimeManager();
1140 ipcType = Util::Util::ToString(IpcTypes::Socket);
1143 case IpcTypes::Pipe:
1145 runtimeManager = CreatePipeRuntimeManager();
1146 ipcType = Util::Util::ToString(IpcTypes::Pipe);
1150 PrintTextCallback(System::String::Format(
"... {0} RuntimeManager created (MinBinVersion: {1})", ipcType, Util::Util::ToString(RuntimeConfig::GetInstance().GetMinBinVersion())));
1152 InitializeRuntimeEvents(runtimeManager);
1153 SetCustomImplementation(runtimeManager);
1155 catch (
const std::exception& ex)
1158 PrintTextCallback(
"... No RuntimeManager created.");
1160 return runtimeManager;
1162 catch (System::Exception^ ex)
1165 PrintTextCallback(
"... No RuntimeManager created.");
1167 return runtimeManager;
1171 PrintTextCallback(
"... No RuntimeManager created.");
1173 return runtimeManager;
1176 return runtimeManager;
1179 System::String^ SampleForm::IpcPortPipeString()
1181 IpcTypes ipcType = Util::Util::ToIpcType(comboBoxIpcType->SelectedItem->ToString());
1184 case IpcTypes::Socket:
1185 return Util::Util::ToString(SampleConstants::PORT_STRING);
1186 case IpcTypes::Pipe:
1187 return Util::Util::ToString(SampleConstants::PIPE_STRING);
1190 return System::String::Empty;
1194 std::shared_ptr<IRuntimeManager> SampleForm::CreateSocketRuntimeManager()
1196 unsigned short rtPort = System::Convert::ToUInt16(textBoxRtPortPipe->Text);
1200 return RuntimeManagerFactory::CreateSocketRuntimeManager(rtPort);
1204 unsigned short diagPort = System::Convert::ToUInt16(textBoxDiagPortPipe->Text);
1205 return RuntimeManagerFactory::CreateSocketRuntimeManager(rtPort, diagPort);
1209 std::shared_ptr<IRuntimeManager> SampleForm::CreatePipeRuntimeManager()
1213 return RuntimeManagerFactory::CreatePipeRuntimeManager(Util::Util::ToString(textBoxRtPortPipe->Text));
1217 return RuntimeManagerFactory::CreatePipeRuntimeManager(Util::Util::ToString(textBoxRtPortPipe->Text), Util::Util::ToString(textBoxDiagPortPipe->Text));
1221 bool SampleForm::NoDiag()
1223 return System::String::IsNullOrWhiteSpace(textBoxDiagPortPipe->Text);
1226 void SampleForm::InitializeRuntimeEvents(std::shared_ptr<IRuntimeManager> runtimeManager)
1228 if (runtimeManager ==
nullptr)
1233 piml->InitializeRuntimeEvents(runtimeManager);
1235 PrintTextCallback(
"Initialization of runtime events finished");
1238 System::Void SampleForm::radioButtonCustomImpl_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
1240 if (piml->GlobalRuntimeManager ==
nullptr)
1245 if (sender !=
nullptr && (
dynamic_cast<System::Windows::Forms::RadioButton^
>(sender))->Checked ==
false)
1250 SetCustomImplementation(piml->GlobalRuntimeManager);
1253 void SampleForm::SetCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
1255 if (runtimeManager ==
nullptr)
1260 System::String^ type =
"";
1261 CustomImplTypes currentCustomImpl = GetCurrentCustomImpl();
1262 switch (currentCustomImpl)
1266 SetOutputWindowImplementation(runtimeManager);
1270 case DefaultCustomImpl:
1272 SetDefaultCustomImplementation(runtimeManager);
1278 RemoveCustomImplementation(runtimeManager);
1286 if (currentCustomImpl != CustomImplTypes::None)
1288 PrintTextCallback(
"Set up " + type +
"custom implementation finished");
1292 CustomImplTypes SampleForm::GetCurrentCustomImpl()
1294 if (radioButtonOuputWindow->Checked)
1296 return CustomImplTypes::OutputImpl;
1298 else if (radioButtonDefaultImplementation->Checked)
1300 return CustomImplTypes::DefaultCustomImpl;
1302 else if (radioButtonNoCustomImplementation->Checked)
1304 return CustomImplTypes::NoCustom;
1307 return CustomImplTypes::None;
1310 void SampleForm::SetOutputWindowImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
1312 if (runtimeManager ==
nullptr)
1317 piml->SetOutputWindowImplementation(runtimeManager);
1320 void SampleForm::SetDefaultCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
1322 if (runtimeManager ==
nullptr)
1327 piml->SetDefaultCustomImplementation(runtimeManager);
1330 void SampleForm::RemoveCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager)
1332 if (runtimeManager ==
nullptr)
1337 piml->RemoveCustomImplementation(runtimeManager);
1340 void SampleForm::ProcedurePendingCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1344 Invoke(
gcnew System::Action<CLRWrapper< IRuntimeContext*>^>(
this, &SampleForm::ProcedurePendingCallback), clrContext);
1348 msclr::lock l(piml->EventListenerLock.get());
1350 IRuntimeContext* context = clrContext->GetPtr();
1351 PrintTextCallback(System::String::Format(
"Event ProcedurePending occurred - {0} - ExecutionState = {1}",
1352 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1353 Util::Util::ToString(context->GetExecutionState())));
1354 UpdateExecutionState(context);
1355 ShowConnectionStateMessage(context);
1359 void SampleForm::ProcedureStartedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1363 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureStartedCallback), clrContext);
1367 msclr::lock l(piml->EventListenerLock.get());
1369 IRuntimeContext* context = clrContext->GetPtr();
1370 PrintTextCallback(System::String::Format(
"Event ProcedureStarted occurred - {0} - ExecutionState = {1} - RuntimeId = {2} - ProcessId = {3}",
1371 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1372 Util::Util::ToString(context->GetExecutionState()),
1373 context->GetRuntimeId().ToString(),
1374 context->GetProcessId().ToString()));
1375 UpdateExecutionState(context);
1379 void SampleForm::ProcedurePaused(IRuntimeContext* context, ExecutionStateChangeReason reason)
1381 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
1382 arr[0] =
gcnew CLRWrapper<IRuntimeContext*>(context);
1383 arr[1] =
gcnew CLRWrapper<ExecutionStateChangeReason>(reason);
1386 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::ProcedurePausedCallback),
gcnew cli::array<System::Object^>{arr});
1390 ProcedurePausedCallback(arr);
1394 void SampleForm::ProcedurePausedCallback(cli::array<System::Object^>^ arr)
1396 if (arr ==
nullptr || arr->Length != 2)
1401 IRuntimeContext* context = Util::Util::CastTo<IRuntimeContext*>(arr[0]);
1404 if (context ==
nullptr)
1409 msclr::lock l(piml->EventListenerLock.get());
1411 PrintTextCallback(System::String::Format(
"Event ProcedurePaused occurred - {0} - ExecutionState = {1} - ExecutionStateChangeReason = {2}",
1412 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1413 Util::Util::ToString(context->GetExecutionState()),
1414 Util::Util::ToString(reason)));
1415 UpdateExecutionState(context, reason);
1416 if (reason == ExecutionStateChangeReason::UnexpectedDiagConnectionState)
1418 ShowConnectionStateMessage(context);
1423 void SampleForm::ProcedureContinuedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1427 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureContinuedCallback), clrContext);
1431 msclr::lock l(piml->EventListenerLock.get());
1433 IRuntimeContext* context = clrContext->GetPtr();
1434 PrintTextCallback(System::String::Format(
"Event ProcedureContinued occurred - {0} - ExecutionState = {1}",
1435 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1436 Util::Util::ToString(context->GetExecutionState())));
1437 UpdateExecutionState(context);
1441 void SampleForm::ProcedureStoppedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1445 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureStoppedCallback), clrContext);
1449 msclr::lock l(piml->EventListenerLock.get());
1451 IRuntimeContext* context = clrContext->GetPtr();
1452 PrintTextCallback(System::String::Format(
"Event ProcedureStopped occurred - {0} - ExecutionState = {1}",
1453 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1454 Util::Util::ToString(context->GetExecutionState())));
1455 UpdateExecutionState(context);
1459 void SampleForm::ProcedureTimeoutCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1463 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureTimeoutCallback), clrContext);
1467 msclr::lock l(piml->EventListenerLock.get());
1469 IRuntimeContext* context = clrContext->GetPtr();
1470 PrintTextCallback(System::String::Format(
"Event ProcedureTimeout occurred - {0} - ExecutionState = {1}",
1471 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1472 Util::Util::ToString(context->GetExecutionState())));
1474 UpdateExecutionState(context);
1478 void SampleForm::DiagConnectionStateChanged(ClampState batteryState, ClampState ignitionState)
1480 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
1481 arr[0] =
gcnew CLRWrapper<ClampState>(batteryState);
1482 arr[1] =
gcnew CLRWrapper<ClampState>(ignitionState);
1485 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::DiagConnectionStateChangedCallback),
gcnew cli::array<System::Object^>{arr});
1489 DiagConnectionStateChangedCallback(arr);
1493 void SampleForm::DiagConnectionStateChangedCallback(cli::array<System::Object^>^ arr)
1495 if (arr ==
nullptr || arr->Length != 2)
1500 ClampState batteryState = Util::Util::CastToEnum<ClampState>(arr[0]);
1501 ClampState ignitionState = Util::Util::CastToEnum<ClampState>(arr[1]);
1504 msclr::lock l(piml->EventListenerLock.get());
1506 PrintTextCallback(System::String::Format(
"Event DiagConnectionStateChanged occurred - BatteryState = {0}, IgnitionState = {1}",
1507 Util::Util::ToString(batteryState),
1508 Util::Util::ToString(ignitionState)));
1509 System::Media::SystemSounds::Beep->Play();
1511 SetBatteryIgnitionState(batteryState, ignitionState);
1516 void SampleForm::ProcedureFinishedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1520 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureFinishedCallback), clrContext);
1524 msclr::lock l(piml->EventListenerLock.get());
1526 IRuntimeContext* context = clrContext->GetPtr();
1527 std::shared_ptr<IProcedureParameter> procedureParameter;
1528 std::string procedureName = context->GetProcedure()->GetFullName();
1529 std::string parameterOutput;
1531 for (
int i = 0; i < context->GetProcedure()->GetParameters().size(); i++)
1533 procedureParameter = context->GetProcedure()->GetParameters().at(i);
1534 parameterOutput =
"Parameter Changed - " + procedureParameter->GetName() +
"(" + procedureParameter->GetDataType() +
") = ";
1536 if (IS_NOT_NULL(procedureParameter->GetValue()))
1538 parameterOutput += ShortenedValueString(procedureParameter->GetValue());
1542 parameterOutput +=
"";
1545 PrintTextCallback(Util::Util::ToString(parameterOutput));
1547 System::DateTime duration = System::DateTime::Now.Subtract(System::TimeSpan(piml->RuntimeContextIdsExecutionStartTick[context->GetRuntimeId()]));
1548 UpdateGridviewParameter(context->GetProcedure());
1550 PrintTextCallback(System::String::Format(
"ProcedureFinished({0}) ExecutionState({1}) - Execution duration {2} - Running time {3} - Used memory {4})",
1551 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1552 Util::Util::ToString(context->GetExecutionState()),
1553 duration.ToString(
"hh':'mm':'ss','fff"),
1554 System::TimeSpan::FromMilliseconds(context->GetExecutionTime()).ToString(
"hh':'mm':'ss','fff"),
1555 System::String::Format(
"{0:0,0} kB", context->GetProcessMemory() / 1024))
1558 UpdateExecutionState(context);
1560 piml->CyclicExecuteAsyncIsProcessing =
false;
1564 void SampleForm::ProcedureAbortedCallback(CLRWrapper<IRuntimeContext*>^ clrContext)
1568 Invoke(
gcnew System::Action<CLRWrapper<IRuntimeContext*>^>(
this, &SampleForm::ProcedureAbortedCallback), clrContext);
1572 IRuntimeContext* context = clrContext->GetPtr();
1573 PrintTextCallback(System::String::Format(
"ProcedureAborted({0}) ExecutionState({1})",
1574 Util::Util::ToString(context->GetProcedure()->GetFullName()),
1575 Util::Util::ToString(context->GetExecutionState())));
1577 if (context->HasRuntimeException())
1579 PrintException(context->GetRuntimeException(),
"Reason: API ");
1582 if (context->HasOtxException())
1584 PrintException(context->GetOtxException(),
"Reason: OTX ");
1586 piml->CyclicExecuteAsyncIsProcessing =
false;
1587 UpdateExecutionState(context);
1590 void SampleForm::UpdateExecutionState(IRuntimeContext* context, ExecutionStateChangeReason reason)
1592 if (context->GetExecutionState() == OpenTestSystem::Otx::Runtime::Api::ExecutionState::Paused)
1594 piml->ProcedureExecutionCount--;
1595 if (reason == ExecutionStateChangeReason::Explicit)
1597 DisplayProcedureExecutionState(context);
1600 UpdatePauseButton(
false, reason == ExecutionStateChangeReason::Explicit);
1604 UpdateExecutionState(context);
1608 void SampleForm::UpdateExecutionState(IRuntimeContext* context)
1610 if (context !=
nullptr)
1612 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
1614 switch (context->GetExecutionState())
1616 case ExecutionState::Running:
1618 piml->ProcedureExecutionCount++;
1620 AddRuntimeContext(context);
1621 DisplayProcedureExecutionState(context);
1623 buttonExecuteMain->Enabled = checkBoxAsyncExecution->Checked;
1624 buttonExecuteSelectedProcedure->Enabled = checkBoxAsyncExecution->Checked;
1626 UpdateExecutionStateButtons(
true);
1627 UpdatePauseButton(
true);
1631 case ExecutionState::Paused:
1633 piml->ProcedureExecutionCount--;
1634 UpdatePauseButton(
false);
1638 case ExecutionState::Pending:
1640 DisplayProcedureExecutionState(context);
1641 UpdateExecutionStateButtons(
true);
1642 UpdatePauseButton(
true,
false);
1646 case ExecutionState::Finished:
1648 piml->ProcedureExecutionCount--;
1650 RemoveRuntimeContext(context);
1651 DisplayProcedureExecutionState(context);
1653 buttonExecuteMain->Enabled = !checkBoxCyclicExecution->Checked;
1654 buttonExecuteSelectedProcedure->Enabled = !checkBoxCyclicExecution->Checked;
1656 UpdateExecutionStateButtons(
false);
1657 UpdatePauseButton(
true,
false);
1659 labelBatteryState->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16"));
1660 labelVoltageThreshold->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16"));
1664 case ExecutionState::Stopped:
1666 piml->ProcedureExecutionCount--;
1668 RemoveRuntimeContext(context);
1669 DisplayProcedureExecutionState(context);
1671 buttonExecuteMain->Enabled =
true;
1672 buttonExecuteSelectedProcedure->Enabled =
true;
1674 UpdateExecutionStateButtons(
false);
1675 UpdatePauseButton(
true,
false);
1677 labelBatteryState->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16"));
1678 labelVoltageThreshold->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16"));
1682 case ExecutionState::Aborted:
1684 piml->ProcedureExecutionCount--;
1686 RemoveRuntimeContext(context);
1687 DisplayProcedureExecutionState(context);
1689 buttonExecuteMain->Enabled =
true;
1690 buttonExecuteSelectedProcedure->Enabled =
true;
1692 UpdateExecutionStateButtons(
false);
1693 UpdatePauseButton(
true,
false);
1695 labelBatteryState->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16"));
1696 labelVoltageThreshold->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16"));
1699 case ExecutionState::Timeout:
1701 System::Media::SystemSounds::Hand->Play();
1703 piml->ProcedureExecutionCount--;
1705 RemoveRuntimeContext(context);
1706 DisplayProcedureExecutionState(context);
1708 buttonExecuteMain->Enabled =
true;
1709 buttonExecuteSelectedProcedure->Enabled =
true;
1711 UpdateExecutionStateButtons(
false);
1712 UpdatePauseButton(
true,
false);
1714 labelBatteryState->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16"));
1715 labelVoltageThreshold->Image = cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16"));
1720 StartStopUpdateGuiTimer();
1724 void SampleForm::StartStopUpdateGuiTimer()
1726 if (piml->ProcedureExecutionCount <= 0)
1728 updateGuiTimer->Enabled =
false;
1729 labelSeparator1->Visible =
false;
1730 labelProcedureExecutionTimes->Visible =
false;
1732 else if (!updateGuiTimer->Enabled)
1734 updateGuiTimer->Enabled =
true;
1738 System::Void SampleForm::updateGuiTimer_Tick(System::Object^ sender, System::EventArgs^ e)
1740 DisplayProcedureExecutionTimes();
1743 void SampleForm::DisplayProcedureExecutionTimes()
1745 System::String^ text = System::String::Empty;
1747 if (piml->RuntimeContextIdsExecutionStartTick.size() > 0)
1749 for (std::map<long long, long long>::iterator itr = piml->RuntimeContextIdsExecutionStartTick.begin();
1750 itr != piml->RuntimeContextIdsExecutionStartTick.end(); ++itr)
1752 System::TimeSpan duration = System::TimeSpan(System::DateTime::Now.Ticks - itr->second);
1753 text += System::String::Format(
"{0}: {1} |",
1754 Util::Util::ToString(GetRuntimeContext(itr->first)->GetProcedure()->GetName()),
1755 duration.ToString(
"mm':'ss"));
1757 text = text->TrimEnd(
gcnew cli::array<wchar_t>{
' ',
'|'});
1760 labelProcedureExecutionTimes->Text = text;
1761 labelSeparator1->Visible =
true;
1762 labelProcedureExecutionTimes->Visible =
true;
1765 void SampleForm::InOutParameterValueChanged(IRuntimeContext* context, IProcedureInOutParameter* parameter)
1767 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
1768 arr[0] =
gcnew CLRWrapper<IRuntimeContext*>(context);
1769 arr[1] =
gcnew CLRWrapper<IProcedureInOutParameter*>(parameter);
1772 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::InOutParameterValueChangedCallback),
gcnew cli::array<System::Object^>{arr});
1776 InOutParameterValueChangedCallback(arr);
1780 void SampleForm::InOutParameterValueChangedCallback(cli::array<System::Object^>^ arr)
1782 if (arr ==
nullptr || arr->Length != 2)
1787 IRuntimeContext* context = Util::Util::CastTo<IRuntimeContext*>(arr[0]);
1788 IProcedureInOutParameter* parameter = Util::Util::CastTo<IProcedureInOutParameter*>(arr[1]);
1790 if (context ==
nullptr || parameter ==
nullptr)
1795 msclr::lock l(piml->EventListenerLock.get());
1799 std::string valueStr = ShortenedValueString(parameter->GetValue());
1800 System::String^ message = System::String::Format(
"Parameter '{0}' new value = {1}",
1801 Util::Util::ToString(parameter->GetName()),
1802 Util::Util::ToString(valueStr));
1803 PrintTextCallback(message);
1804 UpdateGridviewParameter(context->GetProcedure());
1806 catch (
const std::exception& ex)
1808 PrintTextCallback(Util::Util::ToString(ex.what()));
1810 catch (System::InvalidCastException^ ex)
1812 PrintTextCallback(ex->Message);
1817 std::string SampleForm::ShortenedValueString(std::shared_ptr<DataTypes::Object> value)
1821 std::string valueStr = ValueConverter::Value2String(value);
1822 if (valueStr.size() > piml->VALUE_STRING_MAX_LENGTH)
1824 return valueStr.substr(0, piml->VALUE_STRING_MAX_LENGTH) +
"...";
1836 void SampleForm::UpdatePauseButton(
bool pauseAvailable)
1838 UpdatePauseButton(pauseAvailable,
true);
1841 void SampleForm::UpdatePauseButton(
bool pauseAvailable,
bool enabled)
1843 #pragma region C++ for initialize resources
1844 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
1847 buttonPause->Enabled = enabled;
1848 buttonPause->Checked = !pauseAvailable;
1849 buttonPause->Image = pauseAvailable ?
1850 (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonPause.Image"))) :
1851 (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonContinue.Image")));
1854 void SampleForm::UpdateExecutionStateButtons(
bool wasExecuted)
1856 if (piml->UseConnectionState)
1858 labelTimeout->Enabled = !wasExecuted;
1859 textBoxTimeout->Enabled = !wasExecuted;
1860 checkBoxUseConnectionState->Enabled = !wasExecuted;
1861 labelExpectedState->Enabled = !wasExecuted;
1862 checkBoxIgnition->Enabled = !wasExecuted;
1863 labelPollingTime->Enabled = !wasExecuted;
1864 textBoxPollingTime->Enabled = !wasExecuted;
1865 labelVoltageThreshold->Enabled = !wasExecuted;
1866 textBoxVoltageThreshold->Enabled = !wasExecuted;
1871 if (checkBoxAsyncExecution->Checked ==
false)
1873 buttonExecuteMain->Enabled =
false;
1874 buttonExecuteSelectedProcedure->Enabled =
false;
1877 buttonStop->Enabled =
true;
1881 if (IS_NOT_NULL(piml->Project) && IS_NOT_NULL(piml->Project->GetMainProcedure()))
1883 buttonExecuteMain->Enabled =
true;
1886 buttonExecuteSelectedProcedure->Enabled =
true;
1888 buttonStop->Enabled =
false;
1892 void SampleForm::DisplayProcedureExecutionState(IRuntimeContext* context)
1894 DisplayProcedureExecutionState(context,
"");
1897 void SampleForm::DisplayProcedureExecutionState(IRuntimeContext* context, System::String^ errorMessage)
1899 #pragma region C++ for intialize resource
1900 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
1903 if (System::String::IsNullOrEmpty(errorMessage))
1905 labelIconProcedureExecutionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"Info16")));
1907 if (piml->ProcedureExecutionCount <= 0)
1909 piml->ProcedureExecutionCount = 0;
1910 if (context->GetExecutionState() == ExecutionState::Paused)
1912 labelProcedureExecutionState->Text =
"Execution is paused, click \"Continue\"...";
1916 labelProcedureExecutionState->Text =
"Select a procedure and click \"Start\"...";
1919 else if (piml->ProcedureExecutionCount == 1)
1921 labelProcedureExecutionState->Text =
"1 Procedure is running";
1925 labelProcedureExecutionState->Text = System::String::Format(
"{0} Procedures are running", piml->ProcedureExecutionCount);
1930 labelIconProcedureExecutionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"Error16")));
1931 labelProcedureExecutionState->Text = errorMessage;
1935 void SampleForm::SyncWithParent(System::Object^ parentControl)
1937 SyncWithParent(parentControl,
nullptr);
1940 void SampleForm::SyncWithParent(System::Object^ parentControl, System::Object^ control)
1942 SyncWithParent(parentControl, control,
false);
1945 void SampleForm::SyncWithParent(System::Object^ parentControl, System::Object^ control,
bool newThread)
1947 if (parentControl !=
nullptr)
1949 if (IS_NOT_NULL(piml->CreatorForm) && checkBoxStartAllParents->Checked)
1951 if (Util::Util::IsInstance<System::Windows::Forms::Button^>(parentControl))
1955 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentButtonClickCallback), parentControl);
1959 ParentButtonClickCallback(parentControl);
1962 else if (Util::Util::IsInstance<System::Windows::Forms::TextBox^>(parentControl) && control !=
nullptr)
1964 cli::array<System::Object^>^ state =
gcnew cli::array<System::Object^>(2);
1965 state[0] = parentControl;
1966 state[1] = (
dynamic_cast<System::Windows::Forms::Button^
>(control))->Text;
1969 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentTextBoxSetTextCallback), state);
1973 ParentTextBoxSetTextCallback(state);
1976 else if (Util::Util::IsInstance<System::Windows::Forms::CheckBox^>(parentControl) && control !=
nullptr)
1978 cli::array<System::Object^>^ state =
gcnew cli::array<System::Object^>(2);
1979 state[0] = parentControl;
1980 state[1] = (
dynamic_cast<System::Windows::Forms::CheckBox^
> (control))->CheckState;
1983 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentCheckBoxSetCheckStateCallback), state);
1987 ParentCheckBoxSetCheckStateCallback(state);
1990 else if (Util::Util::IsInstance<System::Windows::Forms::ComboBox^>(parentControl) && control !=
nullptr)
1992 cli::array<System::Object^>^ state =
gcnew cli::array<System::Object^>(2);
1993 state[0] = parentControl;
1994 state[1] = (
dynamic_cast<System::Windows::Forms::ComboBox^
>(control))->SelectedIndex;
1997 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentComboBoxSetIndexCallback), state);
2001 ParentComboBoxSetIndexCallback(state);
2004 else if (Util::Util::IsInstance<System::Windows::Forms::NumericUpDown^>(parentControl) && control !=
nullptr)
2006 cli::array<System::Object^>^ state =
gcnew cli::array<System::Object^>(2);
2007 state[0] = parentControl;
2008 state[1] = System::Decimal::ToInt32((
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(control))->Value);
2011 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::ParentNumericUpDownSetValueCallback), state);
2015 ParentNumericUpDownSetValueCallback(state);
2022 void SampleForm::ParentButtonClickCallback(System::Object^ state)
2024 System::Windows::Forms::Button^ parentButton =
dynamic_cast<System::Windows::Forms::Button^
> (state);
2025 if (parentButton ==
nullptr)
2030 if (parentButton->InvokeRequired)
2032 piml->CreatorForm->Invoke(
gcnew System::Action<System::Object^>(
this, &SampleForm::ParentButtonClickCallback), parentButton);
2036 parentButton->PerformClick();
2040 void SampleForm::TextBoxSetTextCallback(cli::array<System::Object^>^ arr)
2042 if (arr ==
nullptr || arr->Length != 2)
return;
2044 System::Windows::Forms::TextBox^ parentTextBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(arr[0]);
2045 System::Windows::Forms::TextBox^ textBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(arr[1]);
2047 if (parentTextBox ==
nullptr || textBox ==
nullptr)
2052 parentTextBox->Text = textBox->Text;
2055 void SampleForm::ParentTextBoxSetTextCallback(System::Object^ state)
2057 cli::array<System::Object^>^ arr =
dynamic_cast<cli::array<System::Object^>^
>(state);
2058 if (arr ==
nullptr || arr->Length != 2)
return;
2060 System::Windows::Forms::TextBox^ parentTextBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(arr[0]);
2061 System::Windows::Forms::TextBox^ textBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(arr[1]);
2063 if (parentTextBox ==
nullptr || textBox ==
nullptr)
2068 if (parentTextBox->InvokeRequired)
2070 piml->CreatorForm->Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::TextBoxSetTextCallback),
gcnew cli::array<System::Object^>{arr});
2074 TextBoxSetTextCallback(arr);
2078 void SampleForm::CheckBoxSetCheckStateCallback(cli::array<System::Object^>^ arr)
2080 if (arr ==
nullptr || arr->Length != 2)
2085 System::Windows::Forms::CheckBox^ parentCheckBox =
dynamic_cast<System::Windows::Forms::CheckBox^
>(arr[0]);
2086 System::Windows::Forms::CheckBox^ checkBox =
dynamic_cast<System::Windows::Forms::CheckBox^
>(arr[1]);
2087 if (parentCheckBox ==
nullptr || checkBox ==
nullptr)
2092 parentCheckBox->CheckState = checkBox->CheckState;
2095 void SampleForm::ParentCheckBoxSetCheckStateCallback(System::Object^ state)
2097 cli::array<System::Object^>^ arr =
dynamic_cast<cli::array<System::Object^>^
>(state);
2098 if (arr ==
nullptr || arr->Length != 2)
return;
2100 System::Windows::Forms::CheckBox^ parentCheckBox =
dynamic_cast<System::Windows::Forms::CheckBox^
>(arr[0]);
2101 System::Windows::Forms::CheckBox^ checkBox =
dynamic_cast<System::Windows::Forms::CheckBox^
>(arr[1]);
2103 if (parentCheckBox ==
nullptr || checkBox ==
nullptr)
2108 if (checkBox->InvokeRequired)
2110 piml->CreatorForm->Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::CheckBoxSetCheckStateCallback),
gcnew cli::array<System::Object^>{arr});
2114 CheckBoxSetCheckStateCallback(arr);
2118 void SampleForm::ComboBoxSetIndexCallback(cli::array<System::Object^>^ arr)
2120 if (arr ==
nullptr || arr->Length != 2)
return;
2122 System::Windows::Forms::ComboBox^ parentComboBox =
dynamic_cast<System::Windows::Forms::ComboBox^
>(arr[0]);
2123 System::Windows::Forms::ComboBox^ comboBox =
dynamic_cast<System::Windows::Forms::ComboBox^
>(arr[1]);
2125 if (parentComboBox ==
nullptr || comboBox ==
nullptr)
2130 parentComboBox->SelectedIndex = comboBox->SelectedIndex;
2133 void SampleForm::ParentComboBoxSetIndexCallback(System::Object^ state)
2135 cli::array<System::Object^>^ arr =
dynamic_cast<cli::array<System::Object^>^
>(state);
2136 if (arr ==
nullptr || arr->Length != 2)
return;
2138 System::Windows::Forms::ComboBox^ parentComboBox =
dynamic_cast<System::Windows::Forms::ComboBox^
>(arr[0]);
2139 System::Windows::Forms::ComboBox^ comboBox =
dynamic_cast<System::Windows::Forms::ComboBox^
>(arr[1]);
2141 if (parentComboBox ==
nullptr || comboBox ==
nullptr)
2146 if (parentComboBox->InvokeRequired)
2148 piml->CreatorForm->Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::ComboBoxSetIndexCallback),
gcnew cli::array<System::Object^>{arr});
2152 ComboBoxSetIndexCallback(arr);
2156 System::Void SampleForm::buttonBrowseTraceFolder_Click(System::Object^ sender, System::EventArgs^ e)
2158 folderBrowserDialog1->SelectedPath = textBoxTraceFolder->Text;
2159 folderBrowserDialog1->ShowNewFolderButton =
true;
2161 System::Windows::Forms::DialogResult result = folderBrowserDialog1->ShowDialog();
2162 if (result == System::Windows::Forms::DialogResult::OK)
2164 textBoxTraceFolder->Text = folderBrowserDialog1->SelectedPath;
2168 System::Void SampleForm::buttonOpenTraceFolder_Click(System::Object^ sender, System::EventArgs^ e)
2170 System::String^ path = textBoxTraceFolder->Text;
2171 if (System::IO::Directory::Exists(path))
2173 System::Diagnostics::Process::Start(path);
2178 System::Void SampleForm::textBoxTraceFolder_TextChanged(System::Object^ sender, System::EventArgs^ e)
2180 if (piml ==
nullptr || piml->GlobalRuntimeManager ==
nullptr)
2185 std::string path = Util::Util::ToString(textBoxTraceFolder->Text);
2187 if (path._Equal(RuntimeConfig::GetInstance().GetTraceFolder()) ==
false)
2189 if (System::IO::Directory::Exists(Util::Util::ToString(path)))
2191 RuntimeConfig::GetInstance().SetTraceFolder(Util::Util::ToString(textBoxTraceFolder->Text));
2192 buttonOpenTraceFolder->Enabled =
true;
2194 PrintTextCallback(
"Set trace folder to " + Util::Util::ToString(RuntimeConfig::GetInstance().GetTraceFolder()));
2198 buttonOpenTraceFolder->Enabled =
false;
2203 buttonOpenTraceFolder->Enabled =
true;
2206 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm.get()->textBoxTraceFolder :
nullptr, textBoxTraceFolder);
2210 System::Void SampleForm::comboBoxTraceLevel_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
2212 if (piml->GlobalRuntimeManager ==
nullptr)
2217 TraceLevels traceLevel = Util::Util::ToTraceLevel(comboBoxTraceLevel->SelectedItem->ToString());
2218 if (traceLevel == RuntimeConfig::GetInstance().GetTraceLevel())
2223 RuntimeConfig::GetInstance().SetTraceLevel(traceLevel);
2224 PrintTextCallback(
"Updated trace level");
2227 System::Void SampleForm::buttonBrowseFile_Click(System::Object^ sender, System::EventArgs^ e)
2229 System::Windows::Forms::DialogResult result = openFileDialog1->ShowDialog();
2230 if (result == System::Windows::Forms::DialogResult::OK)
2232 cbFilePath->Text = openFileDialog1->FileName;
2234 buttonReload->PerformClick();
2238 System::Void SampleForm::cbFilePath_TextChanged(System::Object^ sender, System::EventArgs^ e)
2240 AddComboBoxFileOrPath(cbFilePath);
2242 if (System::String::IsNullOrWhiteSpace(cbFilePath->Text) || !System::IO::File::Exists(cbFilePath->Text->Trim()))
2244 buttonReload->Enabled =
false;
2248 buttonReload->Enabled =
true;
2251 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->cbFilePath :
nullptr, cbFilePath);
2254 System::Void SampleForm::cbFilePath_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
2256 if (System::String::IsNullOrWhiteSpace(cbFilePath->Text) || !System::IO::File::Exists(cbFilePath->Text->Trim()))
2258 buttonReload->Enabled =
false;
2262 buttonReload->Enabled =
true;
2263 if (piml->IsPathChanging ==
false)
2265 buttonReload->PerformClick();
2269 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->cbFilePath :
nullptr, cbFilePath);
2272 System::Void SampleForm::buttonReload_Click(System::Object^ sender, System::EventArgs^ e)
2274 LoadContextFile(piml->GlobalRuntimeManager);
2276 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonReload :
nullptr);
2279 void SampleForm::LoadContextFile(std::shared_ptr<IRuntimeManager> runtimeManager)
2281 if(System::String::IsNullOrWhiteSpace(cbFilePath->Text))
2286 PrintTextCallback(
"Load '" + cbFilePath->Text +
"'...");
2288 if (runtimeManager ==
nullptr)
2290 PrintTextCallback(
"... No RuntimeManager exists!");
2294 if (System::String::IsNullOrWhiteSpace(cbFilePath->Text->Trim()))
2296 PrintTextCallback(
".. wrong file name.");
2300 SetTitle(Util::Util::ToString(piml->Title));
2305 piml->IsLoadding =
true;
2306 piml->PlayerProject =
nullptr;
2307 piml->Project =
nullptr;
2308 piml->ContextVariableImplementation->ResetAllValues();
2309 piml->StateVariableImplementation->ResetAllValues();
2312 System::String^ filePathExtension = System::IO::Path::GetExtension(cbFilePath->Text->Trim());
2313 if (filePathExtension->Contains(
"ptx"))
2315 piml->Project = LoadPtx(runtimeManager);
2317 if (IS_NOT_NULL(piml->Project))
2319 PrintTextCallback(
"... Project '" + Util::Util::ToString(piml->Project->GetName()) +
"' successfully loaded.");
2321 ClearCustomImplemetationCaches();
2323 LoadPackage(piml->Project);
2325 ReadSettings(piml->Project->GetSettings());
2327 piml->IsLoadding =
false;
2331 else if (filePathExtension->Contains(
"ppx"))
2333 piml->PlayerProject = LoadPpx(runtimeManager);
2335 if (IS_NOT_NULL(piml->PlayerProject))
2337 ClearCustomImplemetationCaches();
2339 PrintTextCallback(
"... Player '" + Util::Util::ToString(piml->PlayerProject->GetName()) +
"' successfully loaded.");
2341 std::vector<std::shared_ptr<Project::IProject>> projects = piml->PlayerProject->GetProjects();
2342 for (
int i = 0; i < projects.size(); i++)
2344 piml->Project = projects[i];
2345 LoadPackage(projects[i]);
2348 ReadSettings(piml->PlayerProject->GetSettings());
2350 piml->IsLoadding =
false;
2355 catch (
const std::exception& ex)
2359 catch (System::Exception^ ex)
2364 piml->IsLoadding =
false;
2367 void SampleForm::ClearSampleGUI()
2369 treeViewOtxProject->Nodes->Clear();
2370 gridViewParameter->Rows->Clear();
2371 gridViewContext->Rows->Clear();
2372 gridViewState->Rows->Clear();
2373 gridViewSettings->Rows->Clear();
2376 void SampleForm::ClearCustomImplemetationCaches()
2378 piml->ClearCustomImplemetationCaches();
2382 std::shared_ptr<Project::IProject> SampleForm::LoadPtx(std::shared_ptr<IRuntimeManager> runtimeManager)
2384 std::shared_ptr<Project::IProject> project =
nullptr;
2386 if (runtimeManager->IsProtected(Util::Util::ToString(cbFilePath->Text)))
2388 project = runtimeManager->LoadPtx(Util::Util::ToString(cbFilePath->Text),
2389 Util::Util::ToString(txtPassword->Text->Trim()));
2393 project = runtimeManager->LoadPtx(Util::Util::ToString(cbFilePath->Text));
2396 if (project->GetMainProcedure()!=
nullptr)
2398 buttonExecuteMain->Enabled =
true;
2405 std::shared_ptr<Project::IPlayerProject> SampleForm::LoadPpx(std::shared_ptr<IRuntimeManager> runtimeManager)
2407 std::shared_ptr<Project::IPlayerProject> playerProject =
nullptr;
2409 if (runtimeManager->IsProtected(Util::Util::ToString(cbFilePath->Text)))
2411 playerProject = runtimeManager->LoadPpx(
2412 Util::Util::ToString(cbFilePath->Text),
2413 Util::Util::ToString(txtPassword->Text->Trim()));
2417 playerProject = runtimeManager->LoadPpx(
2418 Util::Util::ToString(cbFilePath->Text));
2421 return playerProject;
2425 void SampleForm::LoadPackage(std::shared_ptr<Project::IProject> project)
2427 PrintTextCallback(
"Browse project...");
2429 std::vector<std::shared_ptr<Otx::Runtime::Api::Otx::IPackage>> packages = project->GetPackages();
2430 if (packages.size() == 0)
2432 std::shared_ptr<IDocument> document = project->GetStartupDocument();
2433 treeViewOtxProject->Nodes->Add(CreateDocumentNode(document));
2437 System::String^ treeNodeText = Util::Util::ToString(project->GetName());
2438 if (!System::String::IsNullOrWhiteSpace(Util::Util::ToString(piml->Project->GetVersion())))
2440 treeNodeText = System::String::Format(
"{0} ({1})", treeNodeText, Util::Util::ToString(project->GetVersion()));
2443 System::Windows::Forms::TreeNode^ root =
gcnew System::Windows::Forms::TreeNode(treeNodeText);
2444 root->ImageKey =
"ODFProject.bmp";
2445 root->SelectedImageKey =
"Package.bmp";
2446 for (
int i = 0; i < packages.size(); i++)
2448 root->Nodes->Add(CreatePackageNode(packages[i]));
2451 treeViewOtxProject->Nodes->Add(root);
2454 treeViewOtxProject->Enabled =
true;
2455 gridViewParameter->Enabled =
true;
2456 treeViewOtxProject->ExpandAll();
2457 treeViewOtxProject->SelectedNode = piml->StartUpNode.get();
2458 treeViewOtxProject->Focus();
2460 PrintTextCallback(
"... project browsing finished.");
2464 System::Windows::Forms::TreeNode^ SampleForm::CreateDocumentNode(std::shared_ptr<Otx::Runtime::Api::Otx::IDocument> doc)
2466 System::Windows::Forms::TreeNode^ documentNode =
gcnew System::Windows::Forms::TreeNode(Util::Util::ToString(doc->GetName()));
2467 documentNode->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IDocument>>(doc);
2468 documentNode->ImageKey =
"DocumentOTX16.bmp";
2469 documentNode->SelectedImageKey =
"DocumentOTX16.bmp";
2470 if (doc->IsStartup())
2472 documentNode->Text +=
" (StartUp)";
2475 std::vector<std::shared_ptr<Otx::Runtime::Api::Otx::IProcedure>> procedures = doc->GetProcedures();
2476 for (
int i = 0; i < procedures.size(); i++)
2478 System::Windows::Forms::TreeNode^ procedureNode = CreateProcedureName(procedures[i]);
2479 documentNode->Nodes->Add(procedureNode);
2480 if (doc->IsStartup() && procedures[i]->GetName()._Equal(
"main"))
2482 piml->StartUpNode = procedureNode;
2483 buttonExecuteMain->Enabled =
true;
2485 else if (piml->StartUpNode.get() ==
nullptr)
2487 piml->StartUpNode = procedureNode;
2491 return documentNode;
2495 System::Windows::Forms::TreeNode ^ SampleForm::CreateProcedureName(std::shared_ptr<Otx::Runtime::Api::Otx::IProcedure> proc)
2497 if (checkBoxCyclicReload->Checked &&
2498 IS_NOT_NULL(piml->ProcedureToExecute) &&
2499 piml->ProcedureToExecute->GetFullName()._Equal(proc->GetFullName()))
2501 piml->ProcedureToExecute = proc;
2504 System::Windows::Forms::TreeNode^ procedureNode =
gcnew System::Windows::Forms::TreeNode(Util::Util::ToString(proc->GetName()));
2505 procedureNode->ImageKey=
"Procedure.bmp";
2506 procedureNode->SelectedImageKey=
"Procedure.bmp";
2507 procedureNode->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IProcedure>>(proc);
2508 return procedureNode;
2511 System::Windows::Forms::TreeNode^ SampleForm::CreatePackageNode(std::shared_ptr<Otx::Runtime::Api::Otx::IPackage> pack)
2513 System::Windows::Forms::TreeNode^ packageNode =
gcnew System::Windows::Forms::TreeNode(Util::Util::ToString(pack->GetName()));
2514 packageNode->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IPackage>>(pack);
2515 packageNode->ImageKey =
"Package.bmp";
2516 packageNode->SelectedImageKey =
"Package.bmp";
2518 std::vector<std::shared_ptr<Otx::Runtime::Api::Otx::IDocument>> documents = pack->GetDocuments();
2519 for (
int i = 0; i < documents.size(); i++)
2521 packageNode->Nodes->Add(CreateDocumentNode(documents[i]));
2524 std::vector<std::shared_ptr<IPackage>> packages = pack->GetPackages();
2525 for (
int i = 0; i < packages.size(); i++)
2527 packageNode->Nodes->Add(CreatePackageNode(packages[i]));
2533 System::Void SampleForm::gridView_CellContentClick(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e)
2539 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2540 System::Windows::Forms::DataGridViewComboBoxCell^ comboBoxCell =
dynamic_cast<System::Windows::Forms::DataGridViewComboBoxCell^
>(gridView->Rows[e->RowIndex]->Cells[e->ColumnIndex]);
2541 if (comboBoxCell !=
nullptr)
2543 gridView->BeginEdit(
true);
2544 dynamic_cast<System::Windows::Forms::DataGridViewComboBoxEditingControl^
>(gridView->EditingControl)->DroppedDown =
true;
2551 gridView_CellValueChanged(sender, e);
2555 System::Void SampleForm::gridView_CellValueChanged(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e)
2557 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2558 System::String^ columnName;
2560 if (gridView == gridViewParameter)
2562 columnName = dataGridViewTextBoxColumnValue->Name;
2564 else if (gridView == gridViewContext)
2566 columnName = dataGridViewTextBoxColumnContextValue->Name;
2573 if (piml !=
nullptr &&
2574 !piml->IsLoadding &&
2576 gridView->Columns[e->ColumnIndex]->Name == columnName &&
2578 Util::Util::IsInstance<System::Windows::Forms::DataGridViewCheckBoxCell^>(gridView->Rows[e->RowIndex]->Cells[columnName]) ||
2579 Util::Util::IsInstance<System::Windows::Forms::DataGridViewComboBoxCell^>(gridView->Rows[e->RowIndex]->Cells[columnName])
2589 System::Void SampleForm::gridViewParameter_CellValidated(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e)
2591 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2592 if (piml !=
nullptr &&
2593 !piml->IsLoadding &&
2594 gridView !=
nullptr &&
2596 gridView->Columns[e->ColumnIndex]->Name == dataGridViewTextBoxColumnValue->Name)
2598 std::shared_ptr<IProcedureParameter> parameter = Util::Util::CastTo<std::shared_ptr<IProcedureParameter>>(gridView->Rows[e->RowIndex]->Tag);
2600 if (parameter->GetValue() !=
nullptr)
2602 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnValue->Name]->Value = ConvertValue2String(parameter->GetValue());
2603 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnDetails->Name]->Value = GetDetails(parameter->GetValue());
2610 System::Void SampleForm::gridViewParameter_CellValidating(System::Object^ sender, System::Windows::Forms::DataGridViewCellValidatingEventArgs^ e)
2612 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2613 if (piml !=
nullptr &&
2614 !piml->IsLoadding &&
2615 gridView !=
nullptr &&
2617 gridView->Columns[e->ColumnIndex]->Name == dataGridViewTextBoxColumnValue->Name &&
2618 !gridView->Rows[e->RowIndex]->ReadOnly &&
2619 e->FormattedValue !=
nullptr)
2621 std::shared_ptr<IProcedureParameter> parameter = Util::Util::CastTo<std::shared_ptr<IProcedureParameter>>(gridView->Rows[e->RowIndex]->Tag);
2622 if (e->FormattedValue->ToString() == Util::Util::ToString(DataTypes::ValueConverter::Value2String(parameter->GetValue())) ||
2623 e->FormattedValue->ToString() == ConvertValue2String(parameter->GetValue()))
2628 std::shared_ptr<DataTypes::Object> value =
nullptr;
2632 value = DataTypes::ValueConverter::String2Value(Util::Util::ToString(e->FormattedValue->ToString()), parameter->GetDataType());
2634 catch (
const std::exception& ex)
2644 catch (System::Exception^ ex)
2655 if (value ==
nullptr)
2657 System::Media::SystemSounds::Exclamation->Play();
2661 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnDataType->Name]->ErrorText = System::String::Empty;
2662 if (std::shared_ptr<IProcedureInParameter> inParam = std::dynamic_pointer_cast<IProcedureInParameter>(parameter))
2664 inParam->SetValue(value);
2666 else if (std::shared_ptr<IProcedureInOutParameter> inOutParam = std::dynamic_pointer_cast<IProcedureInOutParameter>(parameter))
2668 inOutParam->SetValue(value);
2674 System::Void SampleForm::gridViewContextVariable_CellValidated(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e)
2676 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2677 if (piml !=
nullptr &&
2678 !piml->IsLoadding &&
2679 gridView !=
nullptr &&
2681 gridView->Columns[e->ColumnIndex]->Name == dataGridViewTextBoxColumnContextValue->Name)
2683 std::shared_ptr<IContextVariable> context = Util::Util::CastTo<std::shared_ptr<IContextVariable>>(gridView->Rows[e->RowIndex]->Tag);
2684 if (gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag !=
nullptr)
2686 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));
2687 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));
2693 System::Void SampleForm::gridViewContextVariable_CellValidating(System::Object^ sender, System::Windows::Forms::DataGridViewCellValidatingEventArgs^ e)
2695 System::Windows::Forms::DataGridView^ gridView =
dynamic_cast<System::Windows::Forms::DataGridView^
>(sender);
2697 !piml->IsLoadding &&
2698 gridView !=
nullptr &&
2700 gridView->Columns[e->ColumnIndex]->Name == dataGridViewTextBoxColumnContextValue->Name &&
2701 !gridView->Rows[e->RowIndex]->ReadOnly &&
2702 e->FormattedValue !=
nullptr)
2704 std::shared_ptr<IContextVariable> context = Util::Util::CastTo<std::shared_ptr<IContextVariable>>(gridView->Rows[e->RowIndex]->Tag);
2706 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))) ||
2707 e->FormattedValue->ToString() == ConvertValue2String(Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag)))
2712 std::shared_ptr<DataTypes::Object> value =
nullptr;
2716 value = DataTypes::ValueConverter::String2Value(Util::Util::ToString(e->FormattedValue->ToString()), context->GetDataType());
2718 catch (System::Exception^ ex)
2729 if (value ==
nullptr)
2731 System::Media::SystemSounds::Exclamation->Play();
2737 std::string fullNameContextVariable = context->GetDocument()->GetFullName() +
"." + context->GetName();
2738 piml->ContextVariableImplementation->SetValue(fullNameContextVariable, value);
2739 piml->_ContextVariableOutputImpl->SetValue(fullNameContextVariable, value);
2740 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(value);
2741 gridView->Rows[e->RowIndex]->Cells[dataGridViewTextBoxColumnContextDataType->Name]->ErrorText = System::String::Empty;
2746 System::Void SampleForm::treeViewOtxProject_AfterSelect(System::Object^ sender, System::Windows::Forms::TreeViewEventArgs^ e)
2748 System::Windows::Forms::TreeNode^ node = e->Node;
2749 if (node !=
nullptr)
2752 gridViewParameter->Rows->Clear();
2753 gridViewContext->Rows->Clear();
2754 gridViewState->Rows->Clear();
2756 if (Util::Util::IsInstance<CLRWrapper<std::shared_ptr<IProcedure>>^>(node->Tag))
2758 std::shared_ptr<IProcedure> procedure = Util::Util::CastTo<std::shared_ptr<IProcedure>>(node->Tag);
2759 ClearCustomImplemetationCaches();
2760 UpdateGridView(procedure);
2762 buttonExecuteSelectedProcedure->Enabled =
true;
2763 piml->Project = GetProject(procedure);
2768 buttonExecuteSelectedProcedure->Enabled =
false;
2772 std::shared_ptr<Project::IProject> SampleForm::GetProject(std::shared_ptr<IProcedure> procedure)
2774 if (procedure !=
nullptr)
2776 std::shared_ptr<IPackage>
package = procedure->GetDocument()->GetPackage();
2777 if (package !=
nullptr)
2779 while(package->GetParent() !=
nullptr)
2781 package = package->GetParent();
2783 return package->GetProject();
2789 System::Void SampleForm::treeViewOtxProject_DrawNode(System::Object^ sender, System::Windows::Forms::DrawTreeNodeEventArgs^ e)
2791 e->DrawDefault =
true;
2794 System::Void SampleForm::buttonReadSettings_Click(System::Object^ sender, System::EventArgs^ e)
2796 std::map<std::string, std::string> settings;
2797 if (piml->PlayerProject!=
nullptr)
2799 settings = piml->PlayerProject->GetSettings();
2803 settings = piml->Project->GetSettings();
2805 ReadSettings(settings);
2808 void SampleForm::ReadSettings(std::map<std::string, std::string> settings)
2810 PrintTextCallback(
"Read settings");
2812 gridViewSettings->Rows->Clear();
2814 for(std::pair<std::string, std::string> it : settings)
2816 cli::array<System::String^>^ values = {
2817 Util::Util::ToString(it.first),
2818 Util::Util::ToString(it.second)
2820 gridViewSettings->Rows->Add(values);
2825 System::Void SampleForm::buttonWriteSettings_Click(System::Object^ sender, System::EventArgs^ e)
2827 System::String^ nameSetting;
2828 System::String^ valueSetting;
2829 int selectedSettingPosition = 0;
2830 std::map<std::string, std::string> newSettings;
2832 if (gridViewSettings->SelectedRows->Count != 0)
2834 selectedSettingPosition = gridViewSettings->SelectedRows[0]->Index;
2839 if (IS_NOT_NULL(piml->Project) || IS_NOT_NULL(piml->PlayerProject))
2841 for (
int i = 0; i < gridViewSettings->Rows->Count; i++)
2843 nameSetting = gridViewSettings->Rows[i]->Cells[dataGridViewTextBoxColumnSettingName->Name]->Value->ToString();
2845 System::Object^ cellSettingValueValue = gridViewSettings->Rows[i]->Cells[dataGridViewTextBoxColumnSettingValue->Name]->Value;
2846 valueSetting = cellSettingValueValue ==
nullptr ? nullptr : cellSettingValueValue->ToString();
2848 newSettings.insert({Util::Util::ToString(nameSetting),Util::Util::ToString(valueSetting)});
2851 if (piml->PlayerProject !=
nullptr)
2853 piml->PlayerProject->SetSettings(newSettings);
2854 ReadSettings(piml->PlayerProject->GetSettings());
2858 piml->Project->SetSettings(newSettings);
2859 ReadSettings(piml->Project->GetSettings());
2862 gridViewSettings->Rows[selectedSettingPosition]->Selected =
true;
2863 gridViewSettings->Rows[selectedSettingPosition]->Cells[dataGridViewTextBoxColumnSettingValue->Name]->Selected =
true;
2865 PrintTextCallback(
"Write setting finished");
2868 catch (
const std::exception& ex)
2872 catch (System::Exception^ ex)
2878 System::Void SampleForm::checkBoxCyclicExecution_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
2880 checkBoxCyclicReload->Enabled = checkBoxCyclicExecution->Checked;
2881 checkBoxNewRuntimeManager->Enabled = checkBoxCyclicExecution->Checked;
2883 if (!checkBoxCyclicExecution->Checked)
2885 checkBoxCyclicReload->Checked =
false;
2886 checkBoxNewRuntimeManager->Checked =
false;
2889 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxCyclicExecution :
nullptr, checkBoxCyclicExecution);
2892 System::Void SampleForm::checkBoxAsyncExecution_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
2894 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxAsyncExecution :
nullptr, checkBoxAsyncExecution);
2897 System::Void SampleForm::checkBoxNewRuntimeManager_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
2899 if (checkBoxNewRuntimeManager->Checked)
2901 checkBoxCyclicReload->Checked =
true;
2904 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxNewRuntimeManager :
nullptr, checkBoxNewRuntimeManager);
2907 System::Void SampleForm::checkBoxCyclicReload_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
2909 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxCyclicReload :
nullptr, checkBoxCyclicReload);
2912 System::Void SampleForm::buttonExecuteSelectedProcedure_Click(System::Object^ sender, System::EventArgs^ e)
2916 if (treeViewOtxProject->SelectedNode !=
nullptr && Util::Util::IsInstance<CLRWrapper<std::shared_ptr<IProcedure>>^>(treeViewOtxProject->SelectedNode->Tag))
2918 std::shared_ptr<IDocument> document = Util::Util::CastTo<std::shared_ptr<IDocument>>(treeViewOtxProject->SelectedNode->Parent->Tag);
2920 piml->ProcedureToExecute = Util::Util::CastTo<std::shared_ptr<IProcedure>>(treeViewOtxProject->SelectedNode->Tag);
2925 PrintTextCallback(
"Please select Procedure to execute");
2928 catch (
const std::exception& ex)
2932 catch (System::Exception^ ex)
2937 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonExecuteSelectedProcedure :
nullptr, NULL,
true);
2941 System::Void SampleForm::buttonExecuteMain_Click(System::Object^ sender, System::EventArgs^ e)
2945 if (IS_NOT_NULL(piml->Project))
2947 treeViewOtxProject->SelectedNode = piml->StartUpNode.get();
2948 piml->ProcedureToExecute = piml->Project->GetMainProcedure();
2953 PrintTextCallback(
"There is no project has been loaded. Please reload the project");
2956 catch (
const std::exception& ex)
2960 catch (System::Exception^ ex)
2965 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonExecuteMain :
nullptr, NULL,
true);
2969 void SampleForm::ExecuteProcedure()
2971 PrintTextCallback(
"Start procedure execution...");
2973 if (checkBoxAsyncExecution->Checked ==
false)
2975 buttonExecuteMain->Enabled =
false;
2976 buttonExecuteSelectedProcedure->Enabled =
false;
2981 if (IS_NOT_NULL(piml->GlobalRuntimeManager) && IS_NOT_NULL(piml->ProcedureToExecute))
2983 buttonStop->Enabled =
true;
2985 CheckBatteryIgnitionState(piml->GlobalRuntimeManager);
2987 if (checkBoxCyclicExecution->Checked)
2989 System::Threading::ThreadPool::QueueUserWorkItem(
gcnew System::Threading::WaitCallback(
this, &SampleForm::DoCyclic),
nullptr);
2994 if (checkBoxAsyncExecution->Checked)
2996 piml->GlobalRuntimeManager->ExecuteAsync(
2997 Util::Util::ToString(textBoxRuntimeContextName->Text->Trim()),
2998 piml->ProcedureToExecute,
2999 piml->ExpectedConnectionState,
3000 System::Convert::ToUInt64(textBoxTimeout->Text->Trim())
3005 cli::array<System::Object^>^ args =
gcnew cli::array<System::Object^>(4);
3006 args[0] = textBoxRuntimeContextName->Text->Trim();
3007 args[1] =
gcnew CLRWrapper<std::shared_ptr<IProcedure>>(piml->ProcedureToExecute);
3008 args[2] = (int)piml->ExpectedConnectionState;
3009 args[3] = System::Convert::ToUInt64(textBoxTimeout->Text->Trim());
3011 System::Threading::Tasks::Task::Factory->StartNew(
3012 CallbackToAction::Convert(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::ExecuteProcedureSync),
3019 PrintTextCallback(
"RuntimeManager is null or no Procedure is selected to run.");
3022 catch (System::Exception^ ex)
3026 UpdateButtonStateAfterThrowException();
3030 void SampleForm::ExecuteProcedureSync(cli::array<System::Object^>^ args)
3032 if (args->Length != 4)
3037 System::String^ runtimeContextName =
dynamic_cast<System::String^
>(args[0]);
3038 std::shared_ptr<IProcedure> procedureWrapper = Util::Util::CastTo<std::shared_ptr<IProcedure>>(args[1]);
3039 int expectedState = safe_cast<int>(args[2]);
3040 unsigned long long timeout = safe_cast<unsigned long long>(args[3]);
3042 if (procedureWrapper ==
nullptr)
3047 piml->GlobalRuntimeManager->Execute(
3048 Util::Util::ToString(runtimeContextName),
3050 (ExpectedState)expectedState,
3054 void SampleForm::UpdateButtonStateAfterThrowException()
3056 #pragma region C++ for initialize resource
3057 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
3060 buttonExecuteMain->Enabled = !checkBoxAsyncExecution->Checked;
3061 buttonExecuteSelectedProcedure->Enabled = !checkBoxAsyncExecution->Checked;
3063 UpdateExecutionStateButtons(
false);
3064 UpdatePauseButton(
true,
false);
3066 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16")));
3067 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16")));
3071 void SampleForm::DoCyclic(System::Object^ args)
3073 System::DateTime^ startTime = System::DateTime::Now;
3078 while(checkBoxCyclicExecution->Checked)
3080 std::shared_ptr<IRuntimeManager> runtimeManager =
nullptr;
3081 std::shared_ptr<IRuntimeContext> runtimeContext =
nullptr;
3084 piml->CyclicExecutionCount++;
3086 if (checkBoxNewRuntimeManager->Checked)
3088 runtimeManager = CreateRuntimeManager();
3092 runtimeManager = piml->GlobalRuntimeManager;
3095 CheckCyclicReloadOrNewRuntimeManager(runtimeManager);
3097 piml->CyclicExecuteAsyncIsProcessing =
true;
3098 CheckBatteryIgnitionState(piml->GlobalRuntimeManager);
3100 if (checkBoxAsyncExecution->Checked)
3102 runtimeContext = runtimeManager->ExecuteAsync(
3103 Util::Util::ToString(textBoxRuntimeContextName->Text->Trim()),
3104 piml->ProcedureToExecute,
3105 piml->ExpectedConnectionState,
3106 safe_cast<unsigned long long>(System::Convert::ToInt32(textBoxTimeout->Text))
3108 if (runtimeContext !=
nullptr)
3111 System::Windows::Forms::Application::DoEvents();
3112 System::Threading::Thread::Sleep(50);
3117 runtimeContext = runtimeManager->Execute(
3118 Util::Util::ToString(textBoxRuntimeContextName->Text->Trim()),
3119 piml->ProcedureToExecute,
3120 piml->ExpectedConnectionState,
3121 safe_cast<unsigned long long>(System::Convert::ToInt32(textBoxTimeout->Text))
3125 if (runtimeContext->GetExecutionState() == ExecutionState::Stopped)
3127 piml->CyclicExecutionCount = 0;
3132 catch (System::Exception^ ex)
3136 UpdateButtonStateAfterThrowException();
3140 Invoke(
gcnew System::Action<CLRWrapper<std::shared_ptr<IRuntimeManager>>^>(
this, &SampleForm::ReloadContextFileCallback),
gcnew CLRWrapper<std::shared_ptr<IRuntimeManager>>(piml->GlobalRuntimeManager));
3142 PrintTextCallback(
"Cyclic execution finished");
3144 System::TimeSpan duration = System::TimeSpan(System::DateTime::Now.Ticks - startTime->Ticks);
3145 System::String^ text = System::String::Format(
"Execution Statistics: Duration {0} (hh:mm:ss) with {1} cycles and {2:0} ms per cycle",
3146 duration.ToString(
"hh':'mm':'ss"), cyclic, duration.TotalMilliseconds / cyclic);
3148 piml->CyclicExecutionCount -= cyclic;
3149 if (piml->CyclicExecutionCount < 0)
3151 piml->CyclicExecutionCount = 0;
3154 if (checkBoxAdd2Output->Checked)
3156 PrintTextCallback(text);
3160 System::Windows::Forms::MessageBox::Show(text);
3164 void SampleForm::WaitCyclicExecuteAsyncIsProcessing()
3166 if (checkBoxCyclicReload->Checked || checkBoxNewRuntimeManager->Checked)
3169 while(piml->CyclicExecuteAsyncIsProcessing)
3172 System::Windows::Forms::Application::DoEvents();
3173 System::Threading::Thread::Sleep(50);
3178 void SampleForm::CheckCyclicReloadOrNewRuntimeManager(std::shared_ptr<IRuntimeManager> runtimeManager)
3180 CheckCyclicReloadOrNewRuntimeManager(runtimeManager,
true);
3183 void SampleForm::CheckCyclicReloadOrNewRuntimeManager(std::shared_ptr<IRuntimeManager> runtimeManager,
bool waitCyclic)
3187 WaitCyclicExecuteAsyncIsProcessing();
3190 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
3191 arr[0] =
gcnew CLRWrapper<std::shared_ptr<IRuntimeManager>>(runtimeManager);
3192 arr[1] = waitCyclic;
3196 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::CheckCyclicReloadOrNewRuntimeManagerCallback),
gcnew cli::array<System::Object^>{arr});
3200 CheckCyclicReloadOrNewRuntimeManagerCallback(arr);
3204 void SampleForm::CheckCyclicReloadOrNewRuntimeManagerCallback(cli::array<System::Object^>^ arr)
3206 if (arr ==
nullptr || arr->Length != 2)
3211 std::shared_ptr<IRuntimeManager> runtimeManager = Util::Util::CastTo<std::shared_ptr<IRuntimeManager>>(arr[0]);
3212 System::Boolean^ waitCyclic =
dynamic_cast<System::Boolean^
>(arr[1]);
3214 if (runtimeManager ==
nullptr || waitCyclic ==
nullptr)
3219 if (checkBoxCyclicReload->Checked || checkBoxNewRuntimeManager->Checked)
3221 LoadContextFile(runtimeManager);
3224 if (checkBoxCyclicExecution->Checked)
3226 checkBoxCyclicExecution->Text =
"Cyclic (" + piml->CyclicExecutionCount.ToString() +
")";
3230 checkBoxCyclicExecution->Text =
"Cyclic";
3235 System::Void SampleForm::buttonStop_Click(System::Object^ sender, System::EventArgs^ e)
3237 if (piml->GlobalRuntimeManager !=
nullptr)
3239 PrintTextCallback(
"Try to stop all running procedures...");
3240 piml->GlobalRuntimeManager->StopAll();
3241 piml->ProcedureExecutionCount = 0;
3245 checkBoxCyclicExecution->Checked =
false;
3247 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonStop :
nullptr);
3250 void SampleForm::PrintException(System::Exception^ ex)
3252 PrintException(ex,
"");
3255 void SampleForm::PrintException(System::Exception^ ex, System::String^ additionalText)
3257 PrintTextCallback(System::String::Format(
"!!! {2}{0}: {1}", ex->GetType()->Name, ex->Message, additionalText));
3258 System::Media::SystemSounds::Hand->Play();
3261 void SampleForm::PrintException(
const std::exception& ex)
3263 PrintException(ex,
"");
3266 void SampleForm::PrintException(
const std::exception& ex, System::String^ additionalText)
3268 PrintTextCallback(System::String::Format(
"!!! {2}{0}: {1}",
3270 Util::Util::ToString(ex.what()),
3272 System::Media::SystemSounds::Hand->Play();
3275 void SampleForm::PrintTextCallback(System::String^ text)
3279 Invoke(
gcnew System::Action<System::String^>(
this, &SampleForm::PrintTextCallback), text);
3283 if (!checkBoxAdd2Output->Checked)
3289 msclr::lock l(piml->PrintTextLock.get());
3291 if (listBoxOuput->Items->Count >= 10000)
3293 buttonClearOutput_Click(
nullptr,
nullptr);
3296 System::String^ prefixString = GetTimeAndDurationStringSinceLastTimeAndUpdateLastTime();
3297 System::String^ itemToAdd = prefixString + text +
"\t\t";
3299 listBoxOuput->Items->Add(itemToAdd);
3300 listBoxOuput->SelectedItems->Clear();
3301 listBoxOuput->TopIndex = listBoxOuput->Items->Count - 1;
3303 if (listBoxOuput->Items->Count >= 7500)
3305 labelOutputOverflow->Visible =
true;
3310 System::Windows::Forms::Application::DoEvents();
3314 System::String^ SampleForm::GetTimeAndDurationStringSinceLastTimeAndUpdateLastTime()
3316 System::DateTime^ now = System::DateTime::Now;
3317 System::TimeSpan duration = System::TimeSpan(now->Ticks - piml->LastTime.get()->Ticks);
3319 piml->LastTime = now;
3321 System::String^ timeDurationString = System::String::Format(
"{0:HH:mm:ss.fff} {1,6:#,##0} ms ", now, duration.TotalMilliseconds);
3322 return timeDurationString;
3325 System::Void SampleForm::buttonCopyRow_Click(System::Object^ sender, System::EventArgs^ e)
3327 if (listBoxOuput->SelectedItems !=
nullptr)
3329 System::String^ text = System::String::Empty;
3330 for (
int i = 0; i < listBoxOuput->SelectedItems->Count; i++)
3332 text += listBoxOuput->SelectedItems[i]->ToString()->Trim(
'\t') +
"\n";
3335 System::Windows::Forms::Clipboard::SetText(text);
3339 System::Void SampleForm::buttonClearOutput_Click(System::Object^ sender, System::EventArgs^ e)
3341 listBoxOuput->Items->Clear();
3342 labelOutputOverflow->Visible =
false;
3343 buttonCopyRow->Enabled =
false;
3346 void SampleForm::UpdateGridView(std::shared_ptr<IProcedure> procedure)
3349 if (procedure ==
nullptr)
3354 UpdateGridviewParameter(procedure);
3356 std::shared_ptr<Otx::Runtime::Api::Otx::IDocument> document = procedure->GetDocument();
3357 if (IS_NOT_NULL(document))
3359 std::vector<std::string> listItemReviewed;
3360 UpdateGridViewContextVariable(document,
false, listItemReviewed);
3362 listItemReviewed.clear();
3363 UpdateGridViewStateVariable(document,
false, listItemReviewed);
3367 void SampleForm::UpdateGridviewParameter(std::shared_ptr<IProcedure> procedure)
3369 std::vector<std::shared_ptr<IProcedureParameter>> parameters = procedure->GetParameters();
3370 for (
int i = 0; i < parameters.size(); i++)
3372 UpdateGridviewParameter(parameters[i]);
3377 void SampleForm::UpdateGridviewParameter(std::shared_ptr<IProcedureParameter> parameter)
3379 if (IS_NOT_NULL(parameter) ==
false)
3384 bool bValueWasSet =
false;
3387 System::String^ collumnName = dataGridViewTextBoxColumnName->Name;
3388 System::String^ collumnValue = dataGridViewTextBoxColumnValue->Name;
3389 System::String^ collumnDetails = dataGridViewTextBoxColumnDetails->Name;
3390 System::Windows::Forms::DataGridViewRowCollection^ rows = gridViewParameter->Rows;
3391 for (
int i = 0; i < rows->Count; i++)
3393 System::Windows::Forms::DataGridViewRow^ row = rows[i];
3394 if (row->Cells[collumnName]->Value->Equals(Util::Util::ToString(parameter->GetName())))
3398 if (parameter->GetValue() !=
nullptr)
3400 row->Cells[collumnValue]->Value = Util::Util::ToString(ValueConverter::Value2String(parameter->GetValue()));
3403 catch (System::Exception^ ex)
3405 row->Cells[collumnName]->ErrorText = ex->Message;
3408 bValueWasSet =
true;
3416 System::String^ directory = std::dynamic_pointer_cast<IProcedureInParameter>(parameter) ?
"In" :
3417 (std::dynamic_pointer_cast<IProcedureInOutParameter>(parameter) ?
3420 cli::array<System::Object^>^ values = {
3421 Util::Util::ToString(parameter->GetName()),
3423 Util::Util::ToString(parameter->GetDataType())
3425 int index = gridViewParameter->Rows->Add(values);
3427 gridViewParameter->Rows[index]->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IProcedureParameter>>(parameter);
3429 gridViewParameter->Rows[index]->ReadOnly = std::dynamic_pointer_cast<IProcedureOutParameter>(parameter) !=
nullptr || parameter->GetInitValue() ==
nullptr;
3431 if(parameter->GetDataType()._Equal(
"Boolean"))
3433 System::Windows::Forms::DataGridViewCheckBoxCell^ cell =
gcnew System::Windows::Forms::DataGridViewCheckBoxCell();
3434 cell->Value = ConvertValue2String(parameter->GetValue());
3435 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::DataTypes::Object>>(parameter->GetValue());
3436 cell->Style->NullValue =
false;
3437 cell->TrueValue =
true;
3438 cell->FalseValue =
false;
3439 gridViewParameter->Rows[index]->Cells[collumnValue] = cell;
3441 else if (std::shared_ptr<DataTypes::EnumerationElement> enumerationElement = std::dynamic_pointer_cast<DataTypes::EnumerationElement>(parameter->GetValue()))
3443 gridViewParameter->Rows[index]->Cells[collumnValue] =
gcnew System::Windows::Forms::DataGridViewComboBoxCell();
3444 System::Windows::Forms::DataGridViewComboBoxCell^ cell =
dynamic_cast<System::Windows::Forms::DataGridViewComboBoxCell^
>(gridViewParameter->Rows[index]->Cells[collumnValue]);
3445 cell->DisplayStyle = System::Windows::Forms::DataGridViewComboBoxDisplayStyle::ComboBox;
3446 cell->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
3447 cell->DisplayMember =
"Name";
3448 cell->ValueMember =
"Name";
3449 cell->DataSource = Util::Util::ArrayEnumerationElements2String(enumerationElement->GetEnumeration()->GetElements());
3450 cell->Value = ConvertValue2String(parameter->GetValue());
3451 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(parameter->GetValue());
3457 if (parameter->GetValue() !=
nullptr)
3459 gridViewParameter->Rows[index]->Cells[collumnValue]->Value = ConvertValue2String(parameter->GetValue());
3462 catch (System::Exception^ ex)
3464 gridViewParameter->Rows[index]->Cells[collumnValue]->ErrorText = ex->Message;
3468 gridViewParameter->Rows[index]->Cells[collumnDetails]->Value = GetDetails(parameter->GetValue());
3472 System::String^ SampleForm::ConvertValue2String(std::shared_ptr<DataTypes::Object> value)
3476 return System::String::Empty;
3479 return Util::Util::ToString(ValueConverter::Value2String(value));
3482 System::String^ SampleForm::GetDetails(std::shared_ptr<DataTypes::Object> value)
3484 if (value ==
nullptr)
3486 return System::String::Empty;
3489 if (std::shared_ptr<DataTypes::TranslationKey> translationKey = std::dynamic_pointer_cast<DataTypes::TranslationKey>(value))
3491 if (!translationKey->GetTextIdMappingName().empty())
3493 return System::String::Format(
"MappingName: {0}", Util::Util::ToString(translationKey->GetTextIdMappingName()));
3496 else if (std::shared_ptr<DataTypes::EnumerationElement> enumerationElement = std::dynamic_pointer_cast<DataTypes::EnumerationElement>(value))
3498 if (IS_NOT_NULL(enumerationElement->GetTranslationKey()))
3500 if (!enumerationElement->GetTranslationKey()->GetTextId().empty() && !enumerationElement->GetTranslationKey()->GetTextIdMappingName().empty())
3502 return System::String::Format(
"TextId: {0}, MappingName: {1}",
3503 Util::Util::ToString(enumerationElement->GetTranslationKey()->GetTextId()),
3504 Util::Util::ToString(enumerationElement->GetTranslationKey()->GetTextIdMappingName()));
3506 else if (!enumerationElement->GetTranslationKey()->GetTextId().empty())
3508 return System::String::Format(
"TextId: {0}",
3509 Util::Util::ToString(enumerationElement->GetTranslationKey()->GetTextId()));
3512 return System::String::Format(
"MappingName: {0}",
3513 Util::Util::ToString(enumerationElement->GetTranslationKey()->GetTextIdMappingName()));
3517 return System::String::Empty;
3521 void SampleForm::UpdateGridViewContextVariable(std::shared_ptr<IDocument> document,
bool withPrefix, std::vector<std::string>& listItemReviewed)
3523 std::string documentFullName = document->GetPackage()->GetName() +
"." + document->GetName();
3524 if (std::find(listItemReviewed.begin(), listItemReviewed.end(), documentFullName) != listItemReviewed.end())
3529 listItemReviewed.push_back(documentFullName);
3530 for (
int i = 0; i < document->GetContextVariables().size(); i++)
3532 std::shared_ptr<IContextVariable> contextVariable = document->GetContextVariables().at(i);
3534 if (contextVariable ==
nullptr)
3539 bool bValueWasSet =
false;
3542 for (
int i = 0; i < gridViewContext->Rows->Count; i++)
3544 System::Windows::Forms::DataGridViewRow^ row = gridViewContext->Rows[i];
3546 if (row->Cells[dataGridViewTextBoxColumnContextName->Name]->Value !=
nullptr &&
3547 row->Cells[dataGridViewTextBoxColumnContextName->Name]->Value->Equals(withPrefix ?
3548 Util::Util::ToString(document->GetPackage()->GetFullName() +
"." + document->GetName() +
"." + contextVariable->GetName()) :
3549 Util::Util::ToString(contextVariable->GetName())))
3551 if (radioButtonDefaultImplementation->Checked)
3553 std::shared_ptr<DataTypes::Object> contextVariableValue = piml->ContextVariableImplementation->GetValue(
nullptr, contextVariable,
nullptr);
3554 row->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value = IS_NOT_NULL(contextVariableValue) ?
3555 ConvertValue2String(contextVariableValue) :
3560 row->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value = IS_NOT_NULL(contextVariable->GetInitValue()) ?
3561 ConvertValue2String(contextVariable->GetInitValue()) :
3565 bValueWasSet =
true;
3573 cli::array<System::String^>^ values =
nullptr;
3574 values =
gcnew cli::array<System::String^>{
3575 withPrefix ? Util::Util::ToString(document->GetPackage()->GetFullName() +
"." + document->GetName() +
"." + contextVariable->GetName()) :
3576 Util::Util::ToString(contextVariable->GetName()),
3577 Util::Util::ToString(contextVariable->GetDataType())
3579 int index = gridViewContext->Rows->Add(values);
3581 std::shared_ptr<DataTypes::Object> contextVariableValue = contextVariable->GetInitValue();
3583 gridViewContext->Rows[index]->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IContextVariable>>(contextVariable);
3584 gridViewContext->Rows[index]->ReadOnly = contextVariable->GetInitValue() ==
nullptr;
3585 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::DataTypes::Object>>(contextVariable->GetInitValue());
3586 if (contextVariable->GetDataType()._Equal(
"Boolean"))
3588 System::Windows::Forms::DataGridViewCheckBoxCell^ cell =
gcnew System::Windows::Forms::DataGridViewCheckBoxCell();
3589 cell->Value = ConvertValue2String(contextVariableValue);
3590 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name] = cell;
3591 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(contextVariableValue);
3592 cell->Style->NullValue =
false;
3593 cell->TrueValue =
true;
3594 cell->FalseValue =
false;
3596 else if (std::shared_ptr<DataTypes::EnumerationElement> enumerationElement = std::dynamic_pointer_cast<DataTypes::EnumerationElement>(contextVariableValue))
3598 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name] =
gcnew System::Windows::Forms::DataGridViewComboBoxCell();
3599 System::Windows::Forms::DataGridViewComboBoxCell^ cell =
dynamic_cast<System::Windows::Forms::DataGridViewComboBoxCell^
>(gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]);
3600 cell->DisplayStyle = System::Windows::Forms::DataGridViewComboBoxDisplayStyle::ComboBox;
3601 cell->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
3602 cell->DisplayMember =
"Name";
3603 cell->ValueMember =
"Name";
3604 cell->DataSource = Util::Util::ArrayEnumerationElements2String(enumerationElement->GetEnumeration()->GetElements());;
3605 cell->Value = ConvertValue2String(contextVariableValue);
3606 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(contextVariableValue);
3612 if (IS_NOT_NULL(contextVariableValue))
3614 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value = ConvertValue2String(contextVariableValue);
3618 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]->Value =
nullptr;
3621 catch (System::Exception^ ex)
3623 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextValue->Name]->ErrorText = ex->Message;
3627 gridViewContext->Rows[index]->Cells[dataGridViewTextBoxColumnContextDetails->Name]->Value = GetDetails(contextVariableValue);
3633 std::vector<std::shared_ptr<IDocument>> importDocs = document->GetImports();
3634 for (
int i = 0; i < importDocs.size(); i++)
3636 UpdateGridViewContextVariable(importDocs[i],
true, listItemReviewed);
3639 catch (System::Exception^ ex)
3646 void SampleForm::StateVariableValueChanged(std::shared_ptr<IStateVariable> stateVariable, std::shared_ptr<DataTypes::Object> value)
3648 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
3649 arr[0] =
gcnew CLRWrapper<std::shared_ptr<IStateVariable>>(stateVariable);
3650 arr[1] =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(value);
3654 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::StateVariableValueChangedCallback),
gcnew cli::array<System::Object^>{arr});
3658 StateVariableValueChangedCallback(arr);
3663 void SampleForm::StateVariableValueChangedCallback(cli::array<System::Object^>^ arr)
3665 if (arr ==
nullptr || arr->Length != 2)
return;
3667 std::shared_ptr<IStateVariable> stateVariable = Util::Util::CastTo<std::shared_ptr<IStateVariable>>(arr[0]);
3668 std::shared_ptr<DataTypes::Object> value = Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(arr[1]);
3670 if (stateVariable ==
nullptr || value ==
nullptr)
3675 System::String^ mappingStr = System::String::Format(
"[MappedTo: {0}{1}",
3676 Util::Util::ToString(stateVariable->GetMappingName()),
3677 stateVariable->GetMappingIndex() > -1 ? (
"[" + stateVariable->GetMappingIndex() +
"]") : System::String::Empty);
3678 System::String^ strValue =
"null";
3681 strValue = Util::Util::ToString(ValueConverter::Value2String(value));
3687 System::String^ outputLog = System::String::Format(
"StateVariableChanged({0} {1}.{2}{3} = {4})",
3688 Util::Util::ToString(stateVariable->GetDataType()),
3689 Util::Util::ToString(stateVariable->GetDocument()->GetFullName()),
3690 Util::Util::ToString(stateVariable->GetName()),
3693 PrintTextCallback(outputLog);
3694 UpdateGridViewStateVariable(stateVariable);
3697 void SampleForm::ContextVariableRead(std::shared_ptr<IContextVariable> contextVariable, std::shared_ptr<DataTypes::Object> value)
3699 cli::array<System::Object^>^ arr =
gcnew cli::array<System::Object^>(2);
3700 arr[0] =
gcnew CLRWrapper<std::shared_ptr<IContextVariable>>(contextVariable);
3701 arr[1] =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(value);
3705 Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::ContextVariableReadCallback),
gcnew cli::array<System::Object^>{arr});
3709 ContextVariableReadCallback(arr);
3713 void SampleForm::ContextVariableReadCallback(cli::array<System::Object^>^ arr)
3715 if (arr ==
nullptr || arr->Length != 2)
return;
3717 std::shared_ptr<IContextVariable> contextVariable = Util::Util::CastTo<std::shared_ptr<IContextVariable>>(arr[0]);
3718 std::shared_ptr<DataTypes::Object> value = Util::Util::CastTo<std::shared_ptr<DataTypes::Object>>(arr[1]);
3720 if (contextVariable ==
nullptr || value ==
nullptr)
3725 System::String^ mappingStr = System::String::Format(
"[MappedTo: {0}{1}",
3726 Util::Util::ToString(contextVariable->GetMappingName()),
3727 (contextVariable->GetMappingIndex() > -1 ? (
"[" + contextVariable->GetMappingIndex() +
"]") : System::String::Empty));
3728 System::String^ strValue =
"null";
3731 strValue = Util::Util::ToString(ValueConverter::Value2String(value));
3736 System::String^ outputLog = System::String::Format(
"ContextVariableRead({0} {1}.{2}{3} = {4})",
3737 Util::Util::ToString(contextVariable->GetDataType()),
3738 Util::Util::ToString(contextVariable->GetDocument()->GetFullName()),
3739 Util::Util::ToString(contextVariable->GetName()),
3743 PrintTextCallback(outputLog);
3746 void SampleForm::UpdateGridViewStateVariable(std::shared_ptr<IDocument> document,
bool withPrefix, std::vector<std::string>& listItemReviewed)
3748 std::string documentFullName = document->GetPackage()->GetName() +
"." + document->GetName();
3749 if (std::find(listItemReviewed.begin(), listItemReviewed.end(), documentFullName) != listItemReviewed.end())
3754 listItemReviewed.push_back(documentFullName);
3755 std::vector<std::shared_ptr<IStateVariable>> stateVariables = document->GetStateVariables();
3756 for (
int i = 0; i < stateVariables.size(); i++)
3758 std::shared_ptr<IStateVariable> stateVariable = stateVariables[i];
3759 cli::array<System::String^>^ values =
nullptr;
3760 values =
gcnew cli::array<System::String^>{
3761 withPrefix ? Util::Util::ToString(document->GetPackage()->GetFullName() +
"." + document->GetName() +
"." + stateVariable->GetName()) :
3762 Util::Util::ToString(stateVariable->GetName()),
3763 Util::Util::ToString(stateVariable->GetDataType())
3765 int index = gridViewState->Rows->Add(values);
3767 gridViewState->Rows[index]->Tag =
gcnew CLRWrapper<std::shared_ptr<Otx::Runtime::Api::Otx::IStateVariable>>(stateVariable);
3769 if (stateVariable->GetDataType()._Equal(
"Boolean"))
3771 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name] =
gcnew System::Windows::Forms::DataGridViewCheckBoxCell();
3772 System::Windows::Forms::DataGridViewCheckBoxCell^ cell =
dynamic_cast<System::Windows::Forms::DataGridViewCheckBoxCell^
>(gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name]);
3773 cell->Value = ConvertValue2String(stateVariable->GetInitValue());
3774 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(stateVariable->GetInitValue());
3775 cell->Style->NullValue =
false;
3776 cell->TrueValue =
true;
3777 cell->FalseValue =
false;
3779 else if (std::shared_ptr<DataTypes::EnumerationElement> enumerationElement = std::dynamic_pointer_cast<DataTypes::EnumerationElement>(stateVariable->GetInitValue()))
3781 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name] =
gcnew System::Windows::Forms::DataGridViewComboBoxCell();
3782 System::Windows::Forms::DataGridViewComboBoxCell^ cell =
dynamic_cast<System::Windows::Forms::DataGridViewComboBoxCell^
>(gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name]);
3783 cell->DisplayStyle = System::Windows::Forms::DataGridViewComboBoxDisplayStyle::ComboBox;
3784 cell->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
3785 cell->DisplayMember =
"Name";
3786 cell->ValueMember =
"Name";
3787 cell->DataSource = Util::Util::ArrayEnumerationElements2String(enumerationElement->GetEnumeration()->GetElements());;
3788 cell->Value = ConvertValue2String(stateVariable->GetInitValue());
3789 cell->Tag =
gcnew CLRWrapper<std::shared_ptr<DataTypes::Object>>(stateVariable->GetInitValue());
3795 if (IS_NOT_NULL(stateVariable->GetInitValue()))
3797 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name]->Value = ConvertValue2String(stateVariable->GetInitValue());
3800 catch (System::Exception^ ex)
3802 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateValue->Name]->ErrorText = ex->Message;
3806 if (IS_NOT_NULL(stateVariable->GetInitValue()))
3808 gridViewState->Rows[index]->Cells[dataGridViewTextBoxColumnStateDetails->Name]->Value = GetDetails(stateVariable->GetInitValue());
3814 std::vector<std::shared_ptr<IDocument>> importDocs = document->GetImports();
3815 for (
int i = 0; i < importDocs.size(); i++)
3817 UpdateGridViewStateVariable(importDocs[i],
true, listItemReviewed);
3820 catch (
const std::exception& ex)
3824 catch (System::Exception^ ex)
3831 void SampleForm::UpdateGridViewStateVariable(std::shared_ptr<IStateVariable> stateVariable)
3833 if (stateVariable ==
nullptr)
3839 for (
int i = 0; i < gridViewState->Rows->Count; i++)
3841 System::Windows::Forms::DataGridViewRow^ row = gridViewState->Rows[i];
3842 if (row->Cells[dataGridViewTextBoxColumnStateName->Name]->Value !=
nullptr && Util::Util::CastTo<std::shared_ptr<IStateVariable>>(row->Tag) == stateVariable)
3844 std::shared_ptr<DataTypes::Object> stateVariableValue =
nullptr;
3846 if (radioButtonDefaultImplementation->Checked)
3848 stateVariableValue = piml->StateVariableImplementation->GetValue(stateVariable);
3852 stateVariableValue = stateVariable->GetInitValue();
3855 if (IS_NOT_NULL(stateVariableValue))
3859 row->Cells[dataGridViewTextBoxColumnStateValue->Name]->Value = ConvertValue2String(stateVariableValue);
3861 catch (System::Exception^ ex)
3863 row->Cells[dataGridViewTextBoxColumnStateValue->Name]->ErrorText = ex->Message;
3866 row->Cells[dataGridViewTextBoxColumnStateDetails->Name]->Value = GetDetails(stateVariableValue);
3870 row->Cells[dataGridViewTextBoxColumnStateValue->Name]->Value =
nullptr;
3871 row->Cells[dataGridViewTextBoxColumnStateDetails->Name]->Value = System::String::Empty;
3877 System::Windows::Forms::Application::DoEvents();
3880 System::Void SampleForm::buttonNewInstance_Click(System::Object^ sender, System::EventArgs^ e)
3882 SampleForm^ form =
gcnew SampleForm();
3883 form->SetInstanceName(Util::Util::ToString(SampleConstants::CHILD_INSTANCE_NAME));
3884 form->SetCreatorForm(
this);
3888 System::Void SampleForm::buttonNewInstanceNewThread_Click(System::Object^ sender, System::EventArgs^ e)
3890 System::Threading::Thread^ thread =
gcnew System::Threading::Thread(
gcnew System::Threading::ThreadStart(
this, &SampleForm::NewInstanceInThread));
3891 thread->SetApartmentState(System::Threading::ApartmentState::STA);
3895 System::Void SampleForm::NewInstanceInThread()
3897 SampleForm^ form =
gcnew SampleForm();
3898 form->SetInstanceName(Util::Util::ToString(SampleConstants::CHILD_INSTANCE_NAME));
3899 form->SetCreatorForm(
this);
3900 System::Windows::Forms::Application::Run(form);
3903 System::Void SampleForm::buttonHmi_Click(System::Object^ sender, System::EventArgs^ e)
3905 if (buttonHmi->Checked)
3907 piml->HmiWindow =
gcnew HmiWindow();
3908 piml->HmiWindow->FormClosing +=
gcnew System::Windows::Forms::FormClosingEventHandler(
this, &SampleForm::HmiWindow_FormClosing);
3909 piml->HmiWindow->SizeChanged +=
gcnew System::EventHandler(
this, &SampleForm::HmiWindow_SizeChanged);
3910 piml->HmiWindow->Activated +=
gcnew System::EventHandler(
this, &SampleForm::HmiWindow_Activated);
3911 piml->HmiWindow->Show();
3913 piml->HmiWindow->Size = System::Drawing::Size(Setting::UserSettings::GetInstance().GetHmiWindowWidth(), Setting::UserSettings::GetInstance().GetHmiWindowHeight());
3914 piml->HmiWindow->Location = System::Drawing::Point(Location.X + Size.Width, Location.Y);
3915 if (IS_NOT_NULL(piml->CreatorForm) && IS_NOT_NULL(piml->CreatorForm->piml->HmiWindow))
3917 piml->HmiWindow->Size = piml->CreatorForm->piml->HmiWindow->Size;
3920 piml->HmiWindow->BringToFront();
3922 piml->CustomScreenImplementation->SetHmiScreenHandle(piml->HmiWindow->GetHmiControl()->Handle.ToInt64());
3924 else if (IS_NOT_NULL(piml->HmiWindow))
3926 piml->HmiWindow->Close();
3929 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonHmi :
nullptr, buttonHmi);
3932 System::Void SampleForm::HmiWindow_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e)
3934 piml->CustomScreenImplementation->SetHmiScreenHandle(NULL);
3935 piml->HmiWindow =
nullptr;
3937 buttonHmi->Checked =
false;
3940 void SampleForm::HmiWindow_Activated(System::Object^ sender, System::EventArgs^ e)
3942 if (piml->CustomScreenImplementation!=
nullptr)
3944 piml->CustomScreenImplementation->ActivateHmiScreen();
3948 void SampleForm::HmiWindow_SizeChanged(System::Object^ sender, System::EventArgs^ e)
3950 Setting::UserSettings::GetInstance().SetHmiWindowWidth(piml->HmiWindow->Width);
3951 Setting::UserSettings::GetInstance().SetHmiWindowHeight(piml->HmiWindow->Height);
3953 if (piml->CustomScreenImplementation !=
nullptr)
3955 piml->CustomScreenImplementation->RefreshHmiScreen();
3959 void SampleForm::CustomScreenImplementation_KeyDown(std::shared_ptr<Custom::KeyEventArgs> eventArgs)
3961 std::string key =
"Unknown";
3962 if (std::shared_ptr<Custom::WpfKeyEventArgs> wpfKeyEventArgs = std::dynamic_pointer_cast<Custom::WpfKeyEventArgs>(eventArgs))
3964 key = wpfKeyEventArgs->ToString();
3965 if (wpfKeyEventArgs->GetModifierKeys() == Custom::ModifierKeys::Alt &&
3966 wpfKeyEventArgs->GetKey() == Custom::Key::F4)
3968 if (IS_NOT_NULL(piml->HmiWindow))
3970 piml->HmiWindow->Close();
3973 else if (wpfKeyEventArgs->GetKey() == Custom::Key::F10 ||
3974 wpfKeyEventArgs->GetKey() == Custom::Key::LeftAlt ||
3975 wpfKeyEventArgs->GetKey() == Custom::Key::RightAlt)
3977 eventArgs->SetHandled(
true);
3980 else if (std::shared_ptr<Custom::FormKeyEventArgs> formKeyEventArgs = std::dynamic_pointer_cast<Custom::FormKeyEventArgs>(eventArgs))
3982 if (formKeyEventArgs->GetModifierKeys() == Custom::Keys::Alt &&
3983 formKeyEventArgs->GetKey() == Custom::Keys::F4)
3985 if (IS_NOT_NULL(piml->HmiWindow))
3987 piml->HmiWindow->Close();
3990 else if (formKeyEventArgs->GetKey() == Custom::Keys::F10 ||
3991 formKeyEventArgs->GetKey() == Custom::Keys::Alt)
3993 eventArgs->SetHandled(
true);
3995 key = formKeyEventArgs->ToString();
3998 PrintTextCallback(
"CustomScreenImplementation_KeyDown(" + Util::Util::ToString(key) +
")");
4001 System::Void SampleForm::SampleForm_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e)
4004 for (
size_t i = 0; i < piml->ListForms.size(); i++)
4006 if (piml->ListForms.at(i).get() ==
this)
4008 piml->ListForms.erase(piml->ListForms.begin() + i);
4013 if (piml->GlobalRuntimeManager !=
nullptr)
4015 piml->GlobalRuntimeManager->StopAll();
4016 piml->RemoveRuntimeEvents(piml->GlobalRuntimeManager);
4021 piml->RemoveOutputImplLogEventHandler();
4026 void SampleForm::SaveSettings()
4028 if (piml->CreatorForm.get() ==
nullptr)
4031 Setting::UserSettings::GetInstance().SetPtxPpxDirectory(Util::Util::ToString(cbFilePath->Text->Trim()));
4032 Setting::UserSettings::GetInstance().SetPtxPpxDirectoryList(Util::Util::Join(
";", cbFilePath->Items->GetEnumerator()));
4034 Setting::UserSettings::GetInstance().SetTraceFileMaxCount(System::Convert::ToInt32(textBoxTraceFileMaxCount->Text->Trim()));
4035 Setting::UserSettings::GetInstance().SetTraceFileMaxSize(System::Convert::ToInt32(textBoxTraceFileMaxSize->Text->Trim()));
4036 Setting::UserSettings::GetInstance().SetTraceLevels(RuntimeConfig::GetInstance().GetTraceLevel());
4037 Setting::UserSettings::GetInstance().SetTracingDirectory(Util::Util::ToString(textBoxTraceFolder->Text->Trim()));
4039 Setting::UserSettings::GetInstance().SetWindowWidth(Size.Height);
4040 Setting::UserSettings::GetInstance().SetWindowWidth(Size.Width);
4041 Setting::UserSettings::GetInstance().SetWindowLocationX(Location.X);
4042 Setting::UserSettings::GetInstance().SetWindowLocationY(Location.Y);
4043 Setting::UserSettings::GetInstance().SetCustomImplTypes(GetCurrentCustomImpl());
4044 SaveSocketPortOrPipeName();
4046 Setting::UserSettings::GetInstance().SetAsynchron(checkBoxAsyncExecution->Checked);
4047 Setting::UserSettings::GetInstance().SetCyclic(checkBoxCyclicExecution->Checked);
4048 Setting::UserSettings::GetInstance().SetCyclicReload(checkBoxCyclicReload->Checked);
4049 Setting::UserSettings::GetInstance().SetNewRuntimeManager(checkBoxNewRuntimeManager->Checked);
4050 Setting::UserSettings::GetInstance().SetAddMessageToOutput(checkBoxAdd2Output->Checked);
4051 Setting::UserSettings::GetInstance().SetStartAllParents(checkBoxStartAllParents->Checked);
4053 Setting::UserSettings::GetInstance().SetTimeout(System::Convert::ToUInt64(textBoxTimeout->Text->Trim()));
4054 Setting::UserSettings::GetInstance().SetConnectionState(checkBoxUseConnectionState->Checked);
4055 Setting::UserSettings::GetInstance().SetIgnition((
int)checkBoxIgnition->CheckState);
4056 Setting::UserSettings::GetInstance().SetPollingTime(System::Convert::ToInt32(textBoxPollingTime->Text->Trim()));
4057 Setting::UserSettings::GetInstance().SetVoltageThreshold(System::Convert::ToInt32(textBoxVoltageThreshold->Text->Trim()));
4059 Setting::UserSettings::GetInstance().SetRuntimeContextName(Util::Util::ToString(textBoxRuntimeContextName->Text->Trim()));
4061 #pragma region C++ for RAW-mode
4062 Setting::UserSettings::GetInstance().SetDiagIpcType(comboBoxDiagIpcType->SelectedItem !=
nullptr ?
4063 Util::Util::ToIpcType(comboBoxDiagIpcType->SelectedItem->ToString()) :
4065 Setting::UserSettings::GetInstance().SetDiagManagerLicenseKey(Util::LicenseUtil::Encrypt(Util::Util::ToString(textBoxDiagManagerLicenseKey->Text)));
4066 Setting::UserSettings::GetInstance().SetDiagManagerTraceLevel(comboBoxDiagManagerTraceLevel->SelectedItem !=
nullptr ?
4067 Util::Util::ToLoggerLevel(comboBoxDiagManagerTraceLevel->SelectedItem->ToString()) :
4069 Setting::UserSettings::GetInstance().SetDiagLoggingTraceLevel(comboBoxDiagLoggingTraceLevel->SelectedItem !=
nullptr ?
4070 Util::Util::ToDiagDiagnosticsLogLevel(comboBoxDiagLoggingTraceLevel->SelectedItem->ToString()) :
4072 Setting::UserSettings::GetInstance().SetIncludeTraceDiagLogging(checkBoxIncludedDiagLogging->Checked);
4073 Setting::UserSettings::GetInstance().SetDiagTraceDirectory(Util::Util::ToString(textBoxDiagManagerTraceFolder->Text));
4074 Setting::UserSettings::GetInstance().SetOdxProject(comboBoxODXProject->SelectedItem !=
nullptr ?
4075 Util::Util::ToString(comboBoxODXProject->SelectedItem->ToString()) :
4077 Setting::UserSettings::GetInstance().SetOdxVehicleInformation(comboBoxODXVehicle->SelectedItem !=
nullptr ?
4078 Util::Util::ToString(comboBoxODXVehicle->SelectedItem->ToString()) :
4082 Setting::UserSettings::GetInstance().Save();
4086 void SampleForm::SaveSocketPortOrPipeName()
4088 IpcTypes ipcType = Util::Util::ToIpcType(comboBoxIpcType->SelectedItem->ToString());
4092 #pragma region C++ for RAW-mode
4095 Setting::UserSettings::GetInstance().SetIpcType(ipcType);
4099 case IpcTypes::Socket:
4103 Setting::UserSettings::GetInstance().SetDiagManagerPort(System::Convert::ToUInt16(textBoxDiagPortPipe->Text->Trim()));
4104 Setting::UserSettings::GetInstance().SetRuntimePort(System::Convert::ToUInt16(textBoxRtPortPipe->Text->Trim()));
4105 Setting::UserSettings::GetInstance().SetIpcType(ipcType);
4109 Setting::UserSettings::GetInstance().SetDiagManagerPort(SampleConstants::DEFAULT_DM_PORT);
4110 Setting::UserSettings::GetInstance().SetRuntimePort(SampleConstants::DEFAULT_RT_PORT);
4114 case IpcTypes::Pipe:
4116 std::string diagManagerPipeName = Util::Util::ToString(textBoxDiagPortPipe->Text->Trim());
4117 std::string runtimePipeName = Util::Util::ToString(textBoxRtPortPipe->Text->Trim());
4119 Setting::UserSettings::GetInstance().SetDiagManagerPipeName(!diagManagerPipeName.empty() ? diagManagerPipeName : SampleConstants::DEFAULT_DM_PIPE_NAME);
4120 Setting::UserSettings::GetInstance().SetRuntimePipeName(!runtimePipeName.empty() ? runtimePipeName : SampleConstants::DEFAULT_RT_PIPE_NAME);
4121 Setting::UserSettings::GetInstance().SetIpcType(ipcType);
4129 System::Void SampleForm::textBoxRuntimeContextName_TextChanged(System::Object^ sender, System::EventArgs^ e)
4131 textBoxRuntimeContextName->Text = textBoxRuntimeContextName->Text->Trim();
4132 piml->RuntimeContextName = Util::Util::ToString(textBoxRuntimeContextName->Text);
4134 SetTitle(Util::Util::ToString(piml->Title));
4137 System::Void SampleForm::listBoxOuput_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e)
4139 buttonCopyRow->Enabled = listBoxOuput->SelectedItems->Count > 0;
4142 System::Void SampleForm::buttonPause_Click(System::Object^ sender, System::EventArgs^ e)
4144 msclr::lock l(piml->LockRuntimeContexts.get());
4146 if (buttonPause->Checked)
4148 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4150 if (piml->RuntimeContexts[i]->GetExecutionState() == ExecutionState::Running)
4152 piml->RuntimeContexts[i]->Pause();
4158 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4160 if (piml->RuntimeContexts[i]->GetExecutionState() == ExecutionState::Paused)
4162 piml->RuntimeContexts[i]->Continue();
4168 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonPause :
nullptr, buttonPause);
4171 void SampleForm::AddRuntimeContext(IRuntimeContext* context)
4173 msclr::lock l(piml->LockRuntimeContexts.get());
4175 if (std::find(piml->RuntimeContexts.begin(), piml->RuntimeContexts.end(), context) == piml->RuntimeContexts.end())
4177 piml->RuntimeContexts.push_back(context);
4180 if (piml->RuntimeContextIdsExecutionStartTick.find(context->GetRuntimeId()) == piml->RuntimeContextIdsExecutionStartTick.end())
4182 piml->RuntimeContextIdsExecutionStartTick.insert({context->GetRuntimeId(), System::DateTime::Now.Ticks});
4187 void SampleForm::RemoveRuntimeContext(IRuntimeContext* context)
4189 long long contextRuntimeId = context->GetRuntimeId();
4191 msclr::lock l(piml->LockRuntimeContexts.get());
4193 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4195 if (piml->RuntimeContexts[i]->GetRuntimeId() == contextRuntimeId)
4197 piml->RuntimeContexts.erase(piml->RuntimeContexts.begin() + i);
4201 std::map<long long, long long>::iterator itr = piml->RuntimeContextIdsExecutionStartTick.find(contextRuntimeId);
4202 if (itr != piml->RuntimeContextIdsExecutionStartTick.end())
4204 piml->RuntimeContextIdsExecutionStartTick.erase(itr);
4209 bool SampleForm::IsPauseEnabled()
4211 msclr::lock l(piml->LockRuntimeContexts.get());
4213 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4215 if (piml->RuntimeContexts[i]->GetExecutionState() == ExecutionState::Running)
4225 bool SampleForm::IsContinueEnable()
4227 msclr::lock l(piml->LockRuntimeContexts.get());
4229 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4231 if (piml->RuntimeContexts[i]->GetExecutionState() == ExecutionState::Paused)
4240 void SampleForm::SetExpectedState()
4242 if (piml->UseConnectionState)
4244 if (piml->KL15State == -1)
4246 piml->ExpectedConnectionState = ExpectedState::BatteryOn;
4248 else if (piml->KL15State == 1)
4250 piml->ExpectedConnectionState = ExpectedState::IgnitionOn;
4254 piml->ExpectedConnectionState = ExpectedState::IgnitionOff;
4259 piml->ExpectedConnectionState = ExpectedState::None;
4263 System::Void SampleForm::checkBoxUseConnectionState_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
4265 piml->UseConnectionState = checkBoxUseConnectionState->Checked;
4266 EnableConnectionState();
4269 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
4270 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBattery16")));
4271 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnition16")));
4273 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxUseConnectionState :
nullptr, checkBoxUseConnectionState);
4276 System::Void SampleForm::CheckBoxKL15_CheckStateChanged(System::Object^ sender, System::EventArgs^ e)
4278 switch (checkBoxIgnition->CheckState)
4280 case System::Windows::Forms::CheckState::Checked:
4281 piml->KL15State = 1;
4283 case System::Windows::Forms::CheckState::Unchecked:
4284 piml->KL15State = 0;
4287 piml->KL15State = -1;
4293 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxIgnition :
nullptr, checkBoxIgnition);
4296 void SampleForm::EnableConnectionState()
4298 labelExpectedState->Enabled = piml->UseConnectionState;
4299 labelBatteryState->Enabled = piml->UseConnectionState;
4300 checkBoxIgnition->Enabled = piml->UseConnectionState;
4301 labelPollingTime->Enabled = piml->UseConnectionState;
4302 textBoxPollingTime->Enabled = piml->UseConnectionState;
4303 labelVoltageThreshold->Enabled = piml->UseConnectionState;
4304 textBoxVoltageThreshold->Enabled = piml->UseConnectionState;
4305 buttonCheckBatteryIgnition->Enabled = piml->UseConnectionState;
4308 System::Void SampleForm::buttonCheckBatteryIgnition_Click(System::Object^ sender, System::EventArgs^ e)
4310 CheckBatteryIgnitionState(piml->GlobalRuntimeManager);
4312 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->buttonCheckBatteryIgnition :
nullptr, buttonCheckBatteryIgnition);
4315 System::Void SampleForm::textBoxPollingTime_TextChanged(System::Object^ sender, System::EventArgs^ e)
4319 if (System::Convert::ToInt32(textBoxPollingTime->Text->Trim()) <= 0)
4321 textBoxPollingTime->Text = piml->DEFAULT_POLLING_TIME.ToString();
4326 textBoxPollingTime->Text = piml->DEFAULT_POLLING_TIME.ToString();
4329 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxPollingTime :
nullptr, textBoxPollingTime);
4332 System::Void SampleForm::textBoxBatteryVoltageThreshold_TextChanged(System::Object^ sender, System::EventArgs^ e)
4336 if (System::Convert::ToInt32(textBoxVoltageThreshold->Text->Trim()) <= 0)
4338 textBoxVoltageThreshold->Text = piml->DEFAULT_POLLING_TIME.ToString();
4343 textBoxVoltageThreshold->Text = piml->DEFAULT_POLLING_TIME.ToString();
4346 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxVoltageThreshold :
nullptr, textBoxVoltageThreshold);
4349 void SampleForm::CheckBatteryIgnitionState(std::shared_ptr<IRuntimeManager> runtimeManager)
4351 if (piml->UseConnectionState)
4353 runtimeManager->GetDiagConnectionState()->SetPollingTime(System::Convert::ToInt32(textBoxPollingTime->Text));
4354 runtimeManager->GetDiagConnectionState()->SetBatteryVoltageThreshold(System::Convert::ToInt32(textBoxVoltageThreshold->Text));
4355 ClampState batteryState = runtimeManager->GetDiagConnectionState()->GetBatteryState();
4356 ClampState ignitionState = runtimeManager->GetDiagConnectionState()->GetIgnitionState();
4358 SetBatteryIgnitionState(batteryState, ignitionState);
4360 PrintTextCallback(
"Check DiagConnection State - BatteryState = " + Util::Util::ToString(batteryState) +
", IgnitionState = " + Util::Util::ToString(ignitionState));
4364 void SampleForm::SetBatteryIgnitionState(ClampState batteryState, ClampState ignitionState)
4366 #pragma region C++ for initialize resource
4367 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
4370 switch (batteryState)
4373 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBatteryNotAvailable16")));
4375 case OpenTestSystem::Otx::Runtime::Api::ClampState::Off:
4376 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBatteryOff16")));
4379 labelBatteryState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconBatteryOn16")));
4383 switch (ignitionState)
4386 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnitionNotAvailable16")));
4388 case OpenTestSystem::Otx::Runtime::Api::ClampState::Off:
4389 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnitionOff16")));
4392 labelIgnitionState->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"IconIgnitionOn16")));
4397 void SampleForm::ShowConnectionStateMessage(IRuntimeContext* runtimeContext)
4399 if (runtimeContext !=
nullptr)
4401 System::Media::SystemSounds::Beep->Play();
4403 switch (piml->ExpectedConnectionState)
4406 PrintTextCallback(
"----------------------------------------------------------------------------------------------------------------------------------------------");
4407 PrintTextCallback(
"-- Not expected connection state: Either it is not possible to communicate with the VCI or the battery is not connected. Please connect it! --");
4408 PrintTextCallback(
"----------------------------------------------------------------------------------------------------------------------------------------------");
4411 PrintTextCallback(
"------------------------------------------------------------------------------------");
4412 PrintTextCallback(
"-- Not expected connection state: The ignition must be OFF. Please switch it OFF! --");
4413 PrintTextCallback(
"------------------------------------------------------------------------------------");
4416 PrintTextCallback(
"----------------------------------------------------------------------------------");
4417 PrintTextCallback(
"-- Not expected connection state: The ignition must be ON. Please switch it ON! --");
4418 PrintTextCallback(
"----------------------------------------------------------------------------------");
4426 System::Void SampleForm::checkBoxAdd2Output_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
4428 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->checkBoxAdd2Output :
nullptr, checkBoxAdd2Output);
4431 void SampleForm::NumericUpDownSetValueCallback(cli::array<System::Object^>^ arr)
4433 if (arr ==
nullptr || arr->Length != 2)
return;
4435 System::Windows::Forms::NumericUpDown^ numericUpDown =
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(arr[0]);
4436 System::Windows::Forms::NumericUpDown^ control =
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(arr[1]);
4438 numericUpDown->Value = control->Value;
4441 void SampleForm::ParentNumericUpDownSetValueCallback(System::Object^ state)
4443 cli::array<System::Object^>^ arr =
dynamic_cast<cli::array<System::Object^>^
>(state);
4444 if (arr ==
nullptr || arr->Length != 2)
return;
4446 System::Windows::Forms::NumericUpDown^ numericUpDown =
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(arr[0]);
4447 System::Windows::Forms::NumericUpDown^ control =
dynamic_cast<System::Windows::Forms::NumericUpDown^
>(arr[1]);
4449 if (numericUpDown ==
nullptr || control ==
nullptr)
4454 if (numericUpDown->InvokeRequired)
4456 piml->CreatorForm->Invoke(
gcnew System::Action<cli::array<System::Object^>^>(
this, &SampleForm::NumericUpDownSetValueCallback),
gcnew cli::array<System::Object^>{arr});
4460 NumericUpDownSetValueCallback(arr);
4464 System::Void SampleForm::comboBoxTraceLevel_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e)
4466 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->comboBoxTraceLevel :
nullptr,
4467 comboBoxTraceLevel);
4470 System::Void SampleForm::txtPassword_TextChanged(System::Object^ sender, System::EventArgs^ e)
4472 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->txtPassword :
nullptr, txtPassword);
4475 System::Void SampleForm::textBoxTimeout_TextChanged(System::Object^ sender, System::EventArgs^ e)
4477 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxTimeout :
nullptr, textBoxTimeout);
4480 System::Void SampleForm::textBoxTraceFileMaxSize_TextChanged(System::Object^ sender, System::EventArgs^ e)
4482 if (piml->GlobalRuntimeManager ==
nullptr)
4487 PrintTextCallback(
"Set TraceFileMaxSize to " + textBoxTraceFileMaxSize->Text);
4491 RuntimeConfig::GetInstance().SetTraceFileMaxSize(System::Convert::ToInt32(textBoxTraceFileMaxSize->Text));
4492 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxTraceFileMaxSize :
nullptr, textBoxTraceFileMaxSize);
4494 catch (System::Exception^ ex)
4497 textBoxTraceFileMaxSize->Text = RuntimeConfig::GetInstance().GetTraceFileMaxSize().ToString();
4501 System::Void SampleForm::textBoxTraceFileMaxCount_TextChanged(System::Object^ sender, System::EventArgs^ e)
4503 if (piml->GlobalRuntimeManager ==
nullptr)
4508 PrintTextCallback(
"Set TraceFileMaxCount to " + textBoxTraceFileMaxCount->Text);
4512 RuntimeConfig::GetInstance().SetTraceFileMaxCount(System::Convert::ToInt32(textBoxTraceFileMaxCount->Text));
4513 SyncWithParent(IS_NOT_NULL(piml->CreatorForm) ? piml->CreatorForm->textBoxTraceFileMaxCount :
nullptr,
4514 textBoxTraceFileMaxCount);
4516 catch (System::Exception^ ex)
4519 textBoxTraceFileMaxCount->Text = RuntimeConfig::GetInstance().GetTraceFileMaxCount().ToString();
4523 void SampleForm::WebServerTimer_Tick(System::Object^ sender, System::EventArgs^ e)
4525 UpdateWebServerButtonCallback();
4528 void SampleForm::UpdateWebServerButtonCallback()
4532 Invoke(
gcnew System::Action(
this, &SampleForm::UpdateWebServerButtonCallback));
4536 if (piml->CustomScreenImplementation ==
nullptr)
4538 buttonStartStopWebServer->Enabled =
false;
4542 buttonStartStopWebServer->Enabled =
true;
4543 #pragma region C++ for initialize resource
4544 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
4546 if (Custom::DefaultCustomScreenImplementation::IsStartedHtmlWebserver())
4548 if (piml->IsStartWebSever == 1)
4553 buttonStartStopWebServer->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"StopWebServer.image")));
4554 piml->IsStartWebSever = 1;
4558 if (piml->IsStartWebSever == 0)
4563 buttonStartStopWebServer->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"StartWebServer.image")));
4564 piml->IsStartWebSever = 0;
4568 System::Void SampleForm::buttonStartStopWebServer_Click(System::Object^ sender, System::EventArgs^ e)
4570 StartStopWebServerCallback();
4573 void SampleForm::StartStopWebServerCallback()
4577 Invoke(
gcnew System::Action(
this, &SampleForm::StartStopWebServerCallback));
4581 if (piml->CustomScreenImplementation ==
nullptr)
4586 if (Custom::DefaultCustomScreenImplementation::IsStartedHtmlWebserver() ==
false)
4588 piml->CustomScreenImplementation->StartHtmlWebServer();
4592 piml->CustomScreenImplementation->StopHtmlWebServer();
4596 System::Void SampleForm::buttonLicense_Click(System::Object^ sender, System::EventArgs^ e)
4598 LicenseForm^ form =
gcnew LicenseForm();
4599 form->SetParentForm(
this);
4600 if (form !=
nullptr)
4602 form->ShowDialog(
this);
4606 void SampleForm::ReloadRuntimeManager()
4617 piml->GlobalRuntimeManager = CreateRuntimeManager();
4621 catch (
const std::exception& ex)
4624 PrintTextCallback(
"No RuntimeManager created");
4626 catch (System::Exception^ ex)
4629 PrintTextCallback(
"No RuntimeManager created");
4633 #pragma region C++ for Invoke inside DoCyclic
4634 void SampleForm::ReloadContextFileCallback(CLRWrapper<std::shared_ptr<IRuntimeManager>>^ clrRuntimeManager)
4637 if (checkBoxNewRuntimeManager->Checked)
4639 LoadContextFile(clrRuntimeManager->GetPtr());
4645 IRuntimeContext* SampleForm::GetRuntimeContext(
long long runtimeId)
4647 for (
int i = 0; i < piml->RuntimeContexts.size(); i++)
4649 if (piml->RuntimeContexts[i]->GetRuntimeId() == runtimeId)
4651 return piml->RuntimeContexts[i];
4657 void SampleForm::SetInstanceName(System::String^ instanceName)
4659 if (System::String::IsNullOrEmpty(instanceName) ==
false)
4661 piml->Title = Util::Util::ToString(instanceName);
4665 piml->Title = SampleConstants::MAIN_INSTANCE_NAME;
4669 void SampleForm::SetCreatorForm(SampleForm^ creatorForm)
4671 piml->CreatorForm = creatorForm;
4676 #pragma region C++ for RAW-mode
4677 std::shared_ptr<IRuntimeManager> SampleForm::CreateRawRuntimeManager()
4679 std::shared_ptr<IRuntimeManager> runtimeManager =
nullptr;
4680 System::String^ ipcTypeString =
"";
4681 if (comboBoxDiagIpcType->SelectedItem !=
nullptr)
4683 ipcTypeString = comboBoxDiagIpcType->SelectedItem->ToString()->Trim();
4685 IpcTypes ipcType = Util::Util::ToIpcType(ipcTypeString);
4686 std::string licenseKey;
4687 std::shared_ptr<Otx::DiagManager::OtxDiagApi::IOtxDiag> rawOtxDiag =
nullptr;
4688 unsigned short diagPort;
4692 case OpenTestSystem::Otx::Runtime2::Api::Sample::Raw:
4694 comboBoxODXProject->Items->Clear();
4695 comboBoxODXVehicle->Items->Clear();
4697 licenseKey = Util::Util::ToString(textBoxDiagManagerLicenseKey->Text);
4698 rawOtxDiag = Util::OtxDiagUtil::RawOtxDiag(licenseKey);
4699 runtimeManager = RuntimeManagerFactory::CreateRawRuntimeManager(rawOtxDiag);
4701 InitializeODXProject();
4704 case OpenTestSystem::Otx::Runtime2::Api::Sample::Socket:
4706 diagPort = System::Convert::ToUInt16(textBoxDiagPortPipe->Text);
4707 runtimeManager = RuntimeManagerFactory::CreateRawRuntimeManager(diagPort);
4710 case OpenTestSystem::Otx::Runtime2::Api::Sample::Pipe:
4712 runtimeManager = RuntimeManagerFactory::CreateRawRuntimeManager(Util::Util::ToString(textBoxDiagPortPipe->Text));
4717 return runtimeManager;
4720 System::Void SampleForm::comboBoxODXProject_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
4724 std::shared_ptr<Otx::DiagManager::OtxDiagApi::IOtxDiag> rawOtxDiag = Util::OtxDiagUtil::RawOtxDiag();
4725 if (rawOtxDiag !=
nullptr && rawOtxDiag->GetDiagConfiguration() !=
nullptr)
4727 std::string odxProject = Util::Util::ToString(comboBoxODXProject->SelectedItem->ToString());
4728 rawOtxDiag->GetDiagConfiguration()->SelectProject(odxProject);
4730 comboBoxODXVehicle->Items->Clear();
4731 std::vector<std::string> odxVehicles = rawOtxDiag->GetDiagConfiguration()->GetDbVehicleInformationList();
4733 std::string vehicleSetting = Setting::UserSettings::GetInstance().GetOdxVehicleInformation();
4735 for (
size_t i = 0; i < odxVehicles.size(); i++)
4737 std::string odxVehicle = odxVehicles[i];
4738 comboBoxODXVehicle->Items->Add(Util::Util::ToString(odxVehicle));
4740 if (vehicleSetting._Equal(odxVehicle))
4742 comboBoxODXVehicle->SelectedIndex = i;
4746 if (comboBoxODXVehicle->SelectedIndex == -1)
4748 comboBoxODXVehicle->SelectedIndex = 0;
4752 catch (
const std::exception& ex)
4756 catch (System::Exception^ ex)
4762 System::Void SampleForm::comboBoxODXVehicle_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e)
4766 std::shared_ptr<Otx::DiagManager::OtxDiagApi::IOtxDiag> rawOtxDiag = Util::OtxDiagUtil::RawOtxDiag();
4767 rawOtxDiag->GetDiagConfiguration()->SelectVehicleInformation(Util::Util::ToString(comboBoxODXVehicle->SelectedItem->ToString()));
4769 catch (
const std::exception& ex)
4773 catch (System::Exception^ ex)
4779 void SampleForm::InitializeODXProject()
4781 comboBoxODXProject->Items->Clear();
4785 std::string licenseKey = Util::Util::ToString(textBoxDiagManagerLicenseKey->Text);
4786 std::shared_ptr<OpenTestSystem::Otx::DiagManager::OtxDiagApi::IOtxDiag> otxDiag = Util::OtxDiagUtil::RawOtxDiag(licenseKey);
4788 if (otxDiag ==
nullptr)
4793 std::vector<std::string> dbProjectList = otxDiag->GetDiagConfiguration()->GetDbProjectList();
4795 std::string odxProjectSetting = Setting::UserSettings::GetInstance().GetOdxProject();
4796 for (
size_t i = 0; i < dbProjectList.size(); i++)
4798 std::string dbProject = dbProjectList[i];
4799 comboBoxODXProject->Items->Add(Util::Util::ToString(dbProject));
4801 if (odxProjectSetting._Equal(dbProject))
4803 comboBoxODXProject->SelectedIndex = i;
4807 if (comboBoxODXProject->SelectedIndex == -1)
4809 comboBoxODXProject->SelectedIndex = 0;
4812 catch (
const std::exception& ex)
4816 catch (System::Exception^ ex)
4822 void SampleForm::SetupDiagManagerControls()
4825 portPipeLabel->Location = System::Drawing::Point(Width - 324, 65);
4826 textBoxDiagPortPipe->Location = System::Drawing::Point(Width - 221, 62);
4827 textBoxDiagPortPipe->Size = System::Drawing::Size(181, 22);
4831 if (comboBoxDiagIpcType->Items->Count == 0)
4833 comboBoxDiagIpcType->Items->AddRange(Util::Util::ArrayIpcTypes2String());
4834 comboBoxDiagIpcType->SelectedItem = Util::Util::ToString(Setting::UserSettings::GetInstance().GetDiagIpcType());
4837 if (comboBoxDiagManagerTraceLevel->Items->Count == 0)
4839 comboBoxDiagManagerTraceLevel->Items->AddRange(Util::Util::ArrayDiagLoggerLevels2String());
4840 comboBoxDiagManagerTraceLevel->SelectedItem = Util::Util::ToString(Setting::UserSettings::GetInstance().GetDiagManagerTraceLevel());
4843 if (comboBoxDiagLoggingTraceLevel->Items->Count==0)
4845 comboBoxDiagLoggingTraceLevel->Items->AddRange(Util::Util::ArrayDiagnosticLogLevels2String());
4846 comboBoxDiagLoggingTraceLevel->SelectedItem = Util::Util::ToString(Setting::UserSettings::GetInstance().GetDiagLoggingTraceLevel());
4851 System::Void SampleForm::comboBoxDiagIpcType_SelectedValueChanged(System::Object ^ sender, System::EventArgs ^ e)
4853 labelOdxProject->Hide();
4854 comboBoxODXProject->Hide();
4855 labelODXVehicle->Hide();
4856 comboBoxODXVehicle->Hide();
4858 portPipeLabel->Hide();
4859 textBoxDiagPortPipe->Hide();
4861 IpcTypes diagIpcType = Util::Util::ToIpcType(comboBoxDiagIpcType->SelectedItem->ToString());
4862 switch (diagIpcType)
4866 labelOdxProject->Show();
4867 comboBoxODXProject->Show();
4868 labelODXVehicle->Show();
4869 comboBoxODXVehicle->Show();
4871 InitializeODXProject();
4874 case IpcTypes::Socket:
4876 portPipeLabel->Show();
4877 portPipeLabel->Text =
"DiagManager Ports";
4879 textBoxDiagPortPipe->Show();
4880 textBoxDiagPortPipe->Text = piml->DefaultDiagPort.ToString();
4881 textBoxDiagPortPipe->TextChanged+=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
4885 case IpcTypes::Pipe:
4887 portPipeLabel->Show();
4888 portPipeLabel->Text =
"DiagManager Pipes";
4890 textBoxDiagPortPipe->Show();
4891 textBoxDiagPortPipe->Text = Util::Util::ToString(piml->DefaultDiagPipeName);
4892 textBoxDiagPortPipe->TextChanged+=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
4898 piml->GlobalRuntimeManager = CreateRuntimeManager();
4901 System::Void SampleForm::checkBoxIncludedDiagLogging_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
4903 comboBoxDiagLoggingTraceLevel->Enabled = checkBoxIncludedDiagLogging->Checked;
4905 UpdateDiagLogging();
4908 System::Void SampleForm::buttonOpenDiagLoggingTraceFolder_Click(System::Object^ sender, System::EventArgs^ e)
4910 System::String^ path = textBoxDiagManagerTraceFolder->Text;
4911 if (System::IO::Directory::Exists(path))
4913 System::Diagnostics::Process::Start(path);
4917 System::Void SampleForm::buttonBrowseDiagLoggingTraceFolder_Click(System::Object ^ sender, System::EventArgs ^ e)
4919 folderBrowserDialog1->SelectedPath = textBoxDiagManagerTraceFolder->Text;
4920 folderBrowserDialog1->ShowNewFolderButton =
true;
4922 System::Windows::Forms::DialogResult result = folderBrowserDialog1->ShowDialog();
4923 if (result==System::Windows::Forms::DialogResult::OK)
4925 textBoxDiagManagerTraceFolder->Text = folderBrowserDialog1->SelectedPath;
4929 System::Void SampleForm::textBoxDiagManagerLicenseKey_KeyDown(System::Object ^ sender, System::Windows::Forms::KeyEventArgs ^ e)
4931 if (e->KeyCode == System::Windows::Forms::Keys::Delete || e->KeyCode == System::Windows::Forms::Keys::Back)
4933 textBoxDiagManagerLicenseKey->Clear();
4937 System::Void SampleForm::textBoxDiagManagerLicenseKey_TextChanged(System::Object ^ sender, System::EventArgs ^ e)
4939 System::Windows::Forms::TextBox^ textBox =
dynamic_cast<System::Windows::Forms::TextBox^
>(sender);
4940 System::String^ inputRemoveHyphen = textBox->Text->Replace(
"-",
"");
4942 System::Text::StringBuilder^ formattedLicenseKey =
gcnew System::Text::StringBuilder();
4943 for (
int i = 0; i < inputRemoveHyphen->Length; i++)
4945 formattedLicenseKey->Append(inputRemoveHyphen[i]);
4946 if ((i + 1) % 5 == 0 && i + 1 < inputRemoveHyphen->Length)
4948 formattedLicenseKey->Append(
"-");
4952 if (formattedLicenseKey->Length > 29)
4954 formattedLicenseKey->Length = 29;
4957 textBoxDiagManagerLicenseKey->Text = formattedLicenseKey->ToString();
4958 textBoxDiagManagerLicenseKey->SelectionStart = textBoxDiagManagerLicenseKey->Text->Length;
4960 std::string licenseKey = Util::Util::ToString(textBoxDiagManagerLicenseKey->Text);
4961 if (Util::LicenseUtil::CheckLicenseFormat(licenseKey))
4963 this->piml->ErrorProvider->Clear();
4966 std::shared_ptr<OpenTestSystem::Otx::DiagManager::OtxDiagApi::IOtxDiag> otxDiag = Util::OtxDiagUtil::RawOtxDiag(licenseKey);
4968 catch (
const std::exception& ex)
4970 piml->ErrorProvider->SetError(textBoxDiagManagerLicenseKey, Util::Util::ToString(ex.what()));
4972 catch (System::Exception^ ex)
4974 piml->ErrorProvider->SetError(textBoxDiagManagerLicenseKey, ex->Message);
4979 piml->GlobalRuntimeManager = CreateRuntimeManager();
4981 catch (
const std::exception& ex)
4985 catch (System::Exception^ ex)
4992 if (System::String::IsNullOrEmpty(this->piml->ErrorProvider->GetError(textBoxDiagManagerLicenseKey)))
4994 this->piml->ErrorProvider->SetError(textBoxDiagManagerLicenseKey,
"License key does not match the desired format XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.");
4999 System::Void SampleForm::comboBoxDiagManagerTraceLevel_SelectedValueChanged(System::Object ^ sender, System::EventArgs ^ e)
5003 Util::OtxDiagUtil::SetLevelLogger(loggerLevel);
5004 PrintTextCallback(
"Updated trace level");
5007 void SampleForm::UpdateDiagLogging()
5009 if (checkBoxIncludedDiagLogging->Checked && comboBoxDiagLoggingTraceLevel->SelectedItem !=
nullptr)
5012 std::string diagTraceFolder = Util::Util::ToString(textBoxDiagManagerTraceFolder->Text);
5014 Util::OtxDiagUtil::SetDiagDiagnosticLogging(logLevel, diagTraceFolder);
5018 std::string traceFolder = Util::Util::ToString(textBoxDiagManagerTraceFolder->Text->Trim());
5019 Util::OtxDiagUtil::SetDiagDiagnosticLogging(Util::OtxDiagUtil::GetDiagnosticLogLevelDefault(), traceFolder);
5023 System::Void SampleForm::comboBoxDiagLoggingTraceLevel_SelectedValueChanged(System::Object ^ sender, System::EventArgs ^ e)
5025 UpdateDiagLogging();
5028 System::Void SampleForm::textBoxDiagManagerTraceFolder_TextChanged(System::Object^ sender, System::EventArgs^ e)
5030 std::string diagTraceFolder = Util::Util::ToString(textBoxDiagManagerTraceFolder->Text);
5032 Util::OtxDiagUtil::SetPathLogger(diagTraceFolder);
5033 UpdateDiagLogging();
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;
192 SampleFormImpl* piml;
194 void RegisterSettingsEvent();
195 void InitializeInternalComponent();
196 void CreateCustomImpl();
197 void CreateDefaultCustomImpl();
198 void CreateOutputWindowCustomImpl();
199 void InitializeSampleDefaultValues();
201 void AddComboBoxFileOrPath(System::Windows::Forms::ComboBox^ comboBox);
202 void SetupTraceLevel();
203 void SetupTraceFolder();
204 void SetupTraceFileMaxCountAndSize();
205 void SetupDefaultPortAndPipeName();
206 void SetupCustomImplType();
207 void SetupWindowSize();
208 void SetupWindowLocation();
209 bool CheckFormIsInBound(System::Drawing::Point location);
211 void SetupPollingTime();
212 void SetupVoltageThreshold();
213 void UpdateWebServerButtonCallback();
214 void SetRuntimeContextName();
215 void SetTitle(System::String^ title);
216 void SetLocation(SampleForm^ creatorForm);
217 void PrintException(System::Exception^ ex);
218 void PrintException(System::Exception^ ex, System::String^ additionalText);
219 void PrintException(
const std::exception& ex);
220 void PrintException(
const std::exception& ex, System::String^ additionalText);
221 std::shared_ptr<IRuntimeManager> CreateRuntimeManager();
222 std::shared_ptr<IRuntimeManager> CreateRawRuntimeManager();
223 std::shared_ptr<IRuntimeManager> CreateSocketRuntimeManager();
224 std::shared_ptr<IRuntimeManager> CreatePipeRuntimeManager();
226 void InitializeRuntimeEvents(std::shared_ptr<IRuntimeManager> runtimeManager);
227 void SetCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager);
228 CustomImplTypes GetCurrentCustomImpl();
229 void SetOutputWindowImplementation(std::shared_ptr<IRuntimeManager> runtimeManager);
230 void SetDefaultCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager);
231 void RemoveCustomImplementation(std::shared_ptr<IRuntimeManager> runtimeManager);
232 System::String^ GetTimeAndDurationStringSinceLastTimeAndUpdateLastTime();
233 void EnableConnectionState();
234 void SyncWithParent(System::Object^ parentControl);
235 void SyncWithParent(System::Object^ parentControl, System::Object^ control);
236 void SyncWithParent(System::Object^ parentControl, System::Object^ control,
bool newThread);
237 void ParentButtonClickCallback(System::Object^ state);
238 void TextBoxSetTextCallback(cli::array<System::Object^>^ arr);
239 void ParentTextBoxSetTextCallback(System::Object^ state);
240 void CheckBoxSetCheckStateCallback(cli::array<System::Object^>^ arr);
241 void ParentCheckBoxSetCheckStateCallback(System::Object^ state);
242 void ComboBoxSetIndexCallback(cli::array<System::Object^>^ arr);
243 void ParentComboBoxSetIndexCallback(System::Object^ state);
244 void NumericUpDownSetValueCallback(cli::array<System::Object^>^ arr);
245 void ParentNumericUpDownSetValueCallback(System::Object^ state);
246 System::String^ IpcPortPipeString();
247 void LoadContextFile(std::shared_ptr<IRuntimeManager> runtimeManager);
248 void ReloadContextFileCallback(CLRWrapper<std::shared_ptr<IRuntimeManager>>^ clrRuntimeManager);
249 void ClearSampleGUI();
250 std::shared_ptr<Project::IProject> LoadPtx(std::shared_ptr<IRuntimeManager> runtimeManager);
251 void ClearCustomImplemetationCaches();
252 void LoadPackage(std::shared_ptr<Project::IProject> project);
253 System::Windows::Forms::TreeNode^ CreatePackageNode(std::shared_ptr<IPackage> pack);
254 System::Windows::Forms::TreeNode^ CreateDocumentNode(std::shared_ptr<IDocument> doc);
255 System::Windows::Forms::TreeNode^ CreateProcedureName(std::shared_ptr<IProcedure> proc);
256 void ReadSettings(std::map<std::string, std::string> settings);
257 std::shared_ptr<Project::IPlayerProject> LoadPpx(std::shared_ptr<IRuntimeManager> runtimeManager);
258 System::Void HmiWindow_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e);
259 System::Void NewInstanceInThread();
260 void ExecuteProcedure();
261 void ExecuteProcedureSync(cli::array<System::Object^>^ args);
262 void CheckBatteryIgnitionState(std::shared_ptr<IRuntimeManager> runtimeManager);
264 void UpdateGridView(std::shared_ptr<IProcedure> procedure);
265 void UpdateGridviewParameter(std::shared_ptr<IProcedure> procedure);
266 void UpdateGridviewParameter(std::shared_ptr<IProcedureParameter> parameter);
267 System::String^ ConvertValue2String(std::shared_ptr<DataTypes::Object> value);
268 System::String^ GetDetails(std::shared_ptr<DataTypes::Object> value);
269 void UpdateGridViewContextVariable(std::shared_ptr<IDocument> document,
bool withPrefix, std::vector<std::string>& listItemReviewed);
270 void UpdateGridViewStateVariable(std::shared_ptr<IDocument> document,
bool withPrefix, std::vector<std::string>& listItemReviewed);
271 void DoCyclic(System::Object^ args);
272 void CheckCyclicReloadOrNewRuntimeManager(std::shared_ptr<IRuntimeManager> runtimeManager);
273 void CheckCyclicReloadOrNewRuntimeManager(std::shared_ptr<IRuntimeManager> runtimeManager,
bool waitCyclic);
274 void CheckCyclicReloadOrNewRuntimeManagerCallback(cli::array<System::Object^>^ arr);
275 void WaitCyclicExecuteAsyncIsProcessing();
276 void UpdateButtonStateAfterThrowException();
277 void UpdateExecutionStateButtons(
bool wasExecuted);
278 void UpdatePauseButton(
bool pauseAvailable);
279 void UpdatePauseButton(
bool pauseAvailable,
bool enabled);
280 void DisplayProcedureExecutionTimes();
282 void SaveSocketPortOrPipeName();
283 void SetExpectedState();
284 std::shared_ptr<Project::IProject> GetProject(std::shared_ptr<IProcedure> procedure);
290 void DisplayProcedureExecutionState(
IRuntimeContext* context, System::String^ errorMessage);
292 void StartStopUpdateGuiTimer();
294 std::string ShortenedValueString(std::shared_ptr<DataTypes::Object> value);
295 bool IsPauseEnabled();
296 bool IsContinueEnable();
298 void StartStopWebServerCallback();
300 void InitializeODXProject();
301 void SetupDiagManagerControls();
302 void UpdateDiagLogging();
305 void PrintTextCallback(System::String^ text);
306 void ReloadRuntimeManager();
307 void SetInstanceName(System::String^ instanceName);
308 void SetCreatorForm(SampleForm^ creatorForm);
310 void ProcedurePendingCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
311 void ProcedureStartedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
313 void ProcedurePausedCallback(cli::array<System::Object^>^ arr);
314 void ProcedureContinuedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
315 void ProcedureFinishedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
316 void ProcedureStoppedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
317 void ProcedureAbortedCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
318 void ProcedureTimeoutCallback(CLRWrapper<IRuntimeContext*>^ clrContext);
320 void DiagConnectionStateChangedCallback(cli::array<System::Object^>^ arr);
321 void InOutParameterValueChanged(
IRuntimeContext* context, IProcedureInOutParameter* parameter);
322 void InOutParameterValueChangedCallback(cli::array<System::Object^>^ arr);
323 void CustomScreenImplementation_KeyDown(std::shared_ptr<Custom::KeyEventArgs> eventArgs);
325 void ContextVariableRead(std::shared_ptr<IContextVariable> contextVariable, std::shared_ptr<DataTypes::Object> value);
326 void ContextVariableReadCallback(cli::array<System::Object^>^ arr);
327 void StateVariableValueChanged(std::shared_ptr<IStateVariable> stateVariable, std::shared_ptr<DataTypes::Object> value);
328 void StateVariableValueChangedCallback(cli::array<System::Object^>^ arr);
329 void UpdateGridViewStateVariable(std::shared_ptr<IStateVariable> stateVariable);
332 #pragma region Windows Form Designer generated code
337 void InitializeComponent(
void)
339 this->components = (
gcnew System::ComponentModel::Container());
340 System::ComponentModel::ComponentResourceManager^ resources = (
gcnew System::ComponentModel::ComponentResourceManager(SampleForm::typeid));
341 System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle1 = (
gcnew System::Windows::Forms::DataGridViewCellStyle());
342 System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle2 = (
gcnew System::Windows::Forms::DataGridViewCellStyle());
343 System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle3 = (
gcnew System::Windows::Forms::DataGridViewCellStyle());
344 this->panel1 = (
gcnew System::Windows::Forms::Panel());
345 this->buttonBrowseDiagLoggingTraceFolder = (
gcnew System::Windows::Forms::Button());
346 this->buttonOpenDiagLoggingTraceFolder = (
gcnew System::Windows::Forms::Button());
347 this->textBoxDiagManagerTraceFolder = (
gcnew System::Windows::Forms::TextBox());
348 this->label19 = (
gcnew System::Windows::Forms::Label());
349 this->comboBoxDiagLoggingTraceLevel = (
gcnew System::Windows::Forms::ComboBox());
350 this->label17 = (
gcnew System::Windows::Forms::Label());
351 this->checkBoxIncludedDiagLogging = (
gcnew System::Windows::Forms::CheckBox());
352 this->comboBoxDiagManagerTraceLevel = (
gcnew System::Windows::Forms::ComboBox());
353 this->label16 = (
gcnew System::Windows::Forms::Label());
354 this->textBoxDiagManagerLicenseKey = (
gcnew System::Windows::Forms::TextBox());
355 this->label7 = (
gcnew System::Windows::Forms::Label());
356 this->comboBoxDiagIpcType = (
gcnew System::Windows::Forms::ComboBox());
357 this->labelDiagType = (
gcnew System::Windows::Forms::Label());
358 this->labelOdxProject = (
gcnew System::Windows::Forms::Label());
359 this->labelODXVehicle = (
gcnew System::Windows::Forms::Label());
360 this->comboBoxODXVehicle = (
gcnew System::Windows::Forms::ComboBox());
361 this->comboBoxODXProject = (
gcnew System::Windows::Forms::ComboBox());
362 this->label2 = (
gcnew System::Windows::Forms::Label());
363 this->textBoxTraceFileMaxSize = (
gcnew System::Windows::Forms::TextBox());
364 this->textBoxTraceFileMaxCount = (
gcnew System::Windows::Forms::TextBox());
365 this->buttonOpenTraceFolder = (
gcnew System::Windows::Forms::Button());
366 this->textBoxRuntimeContextName = (
gcnew System::Windows::Forms::TextBox());
367 this->runtimeNameLabel = (
gcnew System::Windows::Forms::Label());
368 this->textBoxDiagPortPipe = (
gcnew System::Windows::Forms::TextBox());
369 this->textBoxRtPortPipe = (
gcnew System::Windows::Forms::TextBox());
370 this->label13 = (
gcnew System::Windows::Forms::Label());
371 this->portPipeLabel = (
gcnew System::Windows::Forms::Label());
372 this->comboBoxIpcType = (
gcnew System::Windows::Forms::ComboBox());
373 this->label11 = (
gcnew System::Windows::Forms::Label());
374 this->label10 = (
gcnew System::Windows::Forms::Label());
375 this->buttonBrowseTraceFolder = (
gcnew System::Windows::Forms::Button());
376 this->textBoxTraceFolder = (
gcnew System::Windows::Forms::TextBox());
377 this->label9 = (
gcnew System::Windows::Forms::Label());
378 this->comboBoxTraceLevel = (
gcnew System::Windows::Forms::ComboBox());
379 this->label8 = (
gcnew System::Windows::Forms::Label());
380 this->label6 = (
gcnew System::Windows::Forms::Label());
381 this->buttonReload = (
gcnew System::Windows::Forms::Button());
382 this->txtPassword = (
gcnew System::Windows::Forms::TextBox());
383 this->passwordLabel = (
gcnew System::Windows::Forms::Label());
384 this->buttonBrowseFile = (
gcnew System::Windows::Forms::Button());
385 this->cbFilePath = (
gcnew System::Windows::Forms::ComboBox());
386 this->label1 = (
gcnew System::Windows::Forms::Label());
387 this->textBoxTimeout = (
gcnew System::Windows::Forms::TextBox());
388 this->labelTimeout = (
gcnew System::Windows::Forms::Label());
389 this->textBoxVoltageThreshold = (
gcnew System::Windows::Forms::TextBox());
390 this->labelVoltageThreshold = (
gcnew System::Windows::Forms::Label());
391 this->textBoxPollingTime = (
gcnew System::Windows::Forms::TextBox());
392 this->labelPollingTime = (
gcnew System::Windows::Forms::Label());
393 this->checkBoxIgnition = (
gcnew System::Windows::Forms::CheckBox());
394 this->checkBoxUseConnectionState = (
gcnew System::Windows::Forms::CheckBox());
395 this->panel2 = (
gcnew System::Windows::Forms::Panel());
396 this->buttonLicense = (
gcnew System::Windows::Forms::Button());
397 this->buttonStartStopWebServer = (
gcnew System::Windows::Forms::Button());
398 this->buttonHmi = (
gcnew System::Windows::Forms::CheckBox());
399 this->checkBoxNewRuntimeManager = (
gcnew System::Windows::Forms::CheckBox());
400 this->label15 = (
gcnew System::Windows::Forms::Label());
401 this->label14 = (
gcnew System::Windows::Forms::Label());
402 this->checkBoxCyclicReload = (
gcnew System::Windows::Forms::CheckBox());
403 this->listBoxOuput = (
gcnew System::Windows::Forms::ListBox());
404 this->labelOutputOverflow = (
gcnew System::Windows::Forms::Label());
405 this->buttonCopyRow = (
gcnew System::Windows::Forms::Button());
406 this->buttonClearOutput = (
gcnew System::Windows::Forms::Button());
407 this->buttonNewInstanceNewThread = (
gcnew System::Windows::Forms::Button());
408 this->buttonNewInstance = (
gcnew System::Windows::Forms::Button());
409 this->checkBoxStartAllParents = (
gcnew System::Windows::Forms::CheckBox());
410 this->checkBoxAdd2Output = (
gcnew System::Windows::Forms::CheckBox());
411 this->checkBoxCyclicExecution = (
gcnew System::Windows::Forms::CheckBox());
412 this->checkBoxAsyncExecution = (
gcnew System::Windows::Forms::CheckBox());
413 this->buttonPause = (
gcnew System::Windows::Forms::CheckBox());
414 this->buttonStop = (
gcnew System::Windows::Forms::Button());
415 this->buttonExecuteMain = (
gcnew System::Windows::Forms::Button());
416 this->buttonExecuteSelectedProcedure = (
gcnew System::Windows::Forms::Button());
417 this->openFileDialog1 = (
gcnew System::Windows::Forms::OpenFileDialog());
418 this->splitContainer1 = (
gcnew System::Windows::Forms::SplitContainer());
419 this->treeViewOtxProject = (
gcnew System::Windows::Forms::TreeView());
420 this->label3 = (
gcnew System::Windows::Forms::Label());
421 this->splitContainer5 = (
gcnew System::Windows::Forms::SplitContainer());
422 this->splitContainer2 = (
gcnew System::Windows::Forms::SplitContainer());
423 this->gridViewParameter = (
gcnew System::Windows::Forms::DataGridView());
424 this->dataGridViewTextBoxColumnName = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
425 this->dataGridViewTextBoxColumnDirection = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
426 this->dataGridViewTextBoxColumnDataType = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
427 this->dataGridViewTextBoxColumnValue = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
428 this->dataGridViewTextBoxColumnDetails = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
429 this->labelAdjustProcedureParameters = (
gcnew System::Windows::Forms::Label());
430 this->splitContainer3 = (
gcnew System::Windows::Forms::SplitContainer());
431 this->gridViewContext = (
gcnew System::Windows::Forms::DataGridView());
432 this->dataGridViewTextBoxColumnContextName = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
433 this->dataGridViewTextBoxColumnContextDataType = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
434 this->dataGridViewTextBoxColumnContextValue = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
435 this->dataGridViewTextBoxColumnContextDetails = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
436 this->label4 = (
gcnew System::Windows::Forms::Label());
437 this->gridViewState = (
gcnew System::Windows::Forms::DataGridView());
438 this->dataGridViewTextBoxColumnStateName = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
439 this->dataGridViewTextBoxColumnStateDataType = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
440 this->dataGridViewTextBoxColumnStateValue = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
441 this->dataGridViewTextBoxColumnStateDetails = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
442 this->label5 = (
gcnew System::Windows::Forms::Label());
443 this->panel3 = (
gcnew System::Windows::Forms::Panel());
444 this->gridViewSettings = (
gcnew System::Windows::Forms::DataGridView());
445 this->dataGridViewTextBoxColumnSettingName = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
446 this->dataGridViewTextBoxColumnSettingValue = (
gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
447 this->panel4 = (
gcnew System::Windows::Forms::Panel());
448 this->label12 = (
gcnew System::Windows::Forms::Label());
449 this->buttonWriteSettings = (
gcnew System::Windows::Forms::Button());
450 this->buttonReadSettings = (
gcnew System::Windows::Forms::Button());
451 this->groupBox1 = (
gcnew System::Windows::Forms::GroupBox());
452 this->radioButtonNoCustomImplementation = (
gcnew System::Windows::Forms::RadioButton());
453 this->radioButtonDefaultImplementation = (
gcnew System::Windows::Forms::RadioButton());
454 this->radioButtonOuputWindow = (
gcnew System::Windows::Forms::RadioButton());
455 this->splitContainer4 = (
gcnew System::Windows::Forms::SplitContainer());
456 this->folderBrowserDialog1 = (
gcnew System::Windows::Forms::FolderBrowserDialog());
457 this->imageList1 = (
gcnew System::Windows::Forms::ImageList(this->components));
458 this->labelSeparator2 = (
gcnew System::Windows::Forms::Label());
459 this->labelProcedureExecutionState = (
gcnew System::Windows::Forms::Label());
460 this->tableLayoutPanelExecutionState = (
gcnew System::Windows::Forms::TableLayoutPanel());
461 this->labelIconProcedureExecutionState = (
gcnew System::Windows::Forms::Label());
462 this->labelBatteryState = (
gcnew System::Windows::Forms::Label());
463 this->labelExpectedState = (
gcnew System::Windows::Forms::Label());
464 this->labelSeparator3 = (
gcnew System::Windows::Forms::Label());
465 this->labelSeparator4 = (
gcnew System::Windows::Forms::Label());
466 this->labelSeparator1 = (
gcnew System::Windows::Forms::Label());
467 this->buttonCheckBatteryIgnition = (
gcnew System::Windows::Forms::Button());
468 this->labelIgnitionState = (
gcnew System::Windows::Forms::Label());
469 this->labelSeparator5 = (
gcnew System::Windows::Forms::Label());
470 this->labelProcedureExecutionTimes = (
gcnew System::Windows::Forms::Label());
471 this->label18 = (
gcnew System::Windows::Forms::Label());
472 this->updateGuiTimer = (
gcnew System::Windows::Forms::Timer(this->components));
473 this->toolTip1 = (
gcnew System::Windows::Forms::ToolTip(this->components));
474 this->panel1->SuspendLayout();
475 this->panel2->SuspendLayout();
476 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer1))->BeginInit();
477 this->splitContainer1->Panel1->SuspendLayout();
478 this->splitContainer1->Panel2->SuspendLayout();
479 this->splitContainer1->SuspendLayout();
480 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer5))->BeginInit();
481 this->splitContainer5->Panel1->SuspendLayout();
482 this->splitContainer5->Panel2->SuspendLayout();
483 this->splitContainer5->SuspendLayout();
484 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer2))->BeginInit();
485 this->splitContainer2->Panel1->SuspendLayout();
486 this->splitContainer2->Panel2->SuspendLayout();
487 this->splitContainer2->SuspendLayout();
488 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewParameter))->BeginInit();
489 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer3))->BeginInit();
490 this->splitContainer3->Panel1->SuspendLayout();
491 this->splitContainer3->Panel2->SuspendLayout();
492 this->splitContainer3->SuspendLayout();
493 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewContext))->BeginInit();
494 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewState))->BeginInit();
495 this->panel3->SuspendLayout();
496 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->gridViewSettings))->BeginInit();
497 this->panel4->SuspendLayout();
498 this->groupBox1->SuspendLayout();
499 (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer4))->BeginInit();
500 this->splitContainer4->Panel1->SuspendLayout();
501 this->splitContainer4->Panel2->SuspendLayout();
502 this->splitContainer4->SuspendLayout();
503 this->tableLayoutPanelExecutionState->SuspendLayout();
504 this->SuspendLayout();
508 this->panel1->Controls->Add(this->buttonBrowseDiagLoggingTraceFolder);
509 this->panel1->Controls->Add(this->buttonOpenDiagLoggingTraceFolder);
510 this->panel1->Controls->Add(this->textBoxDiagManagerTraceFolder);
511 this->panel1->Controls->Add(this->label19);
512 this->panel1->Controls->Add(this->comboBoxDiagLoggingTraceLevel);
513 this->panel1->Controls->Add(this->label17);
514 this->panel1->Controls->Add(this->checkBoxIncludedDiagLogging);
515 this->panel1->Controls->Add(this->comboBoxDiagManagerTraceLevel);
516 this->panel1->Controls->Add(this->label16);
517 this->panel1->Controls->Add(this->textBoxDiagManagerLicenseKey);
518 this->panel1->Controls->Add(this->label7);
519 this->panel1->Controls->Add(this->comboBoxDiagIpcType);
520 this->panel1->Controls->Add(this->labelDiagType);
521 this->panel1->Controls->Add(this->labelOdxProject);
522 this->panel1->Controls->Add(this->labelODXVehicle);
523 this->panel1->Controls->Add(this->comboBoxODXVehicle);
524 this->panel1->Controls->Add(this->comboBoxODXProject);
525 this->panel1->Controls->Add(this->label2);
526 this->panel1->Controls->Add(this->textBoxTraceFileMaxSize);
527 this->panel1->Controls->Add(this->textBoxTraceFileMaxCount);
528 this->panel1->Controls->Add(this->buttonOpenTraceFolder);
529 this->panel1->Controls->Add(this->textBoxRuntimeContextName);
530 this->panel1->Controls->Add(this->runtimeNameLabel);
531 this->panel1->Controls->Add(this->textBoxDiagPortPipe);
532 this->panel1->Controls->Add(this->textBoxRtPortPipe);
533 this->panel1->Controls->Add(this->label13);
534 this->panel1->Controls->Add(this->portPipeLabel);
535 this->panel1->Controls->Add(this->comboBoxIpcType);
536 this->panel1->Controls->Add(this->label11);
537 this->panel1->Controls->Add(this->label10);
538 this->panel1->Controls->Add(this->buttonBrowseTraceFolder);
539 this->panel1->Controls->Add(this->textBoxTraceFolder);
540 this->panel1->Controls->Add(this->label9);
541 this->panel1->Controls->Add(this->comboBoxTraceLevel);
542 this->panel1->Controls->Add(this->label8);
543 this->panel1->Controls->Add(this->label6);
544 this->panel1->Controls->Add(this->buttonReload);
545 this->panel1->Controls->Add(this->txtPassword);
546 this->panel1->Controls->Add(this->passwordLabel);
547 this->panel1->Controls->Add(this->buttonBrowseFile);
548 this->panel1->Controls->Add(this->cbFilePath);
549 this->panel1->Controls->Add(this->label1);
550 this->panel1->Dock = System::Windows::Forms::DockStyle::Top;
551 this->panel1->Location = System::Drawing::Point(0, 0);
552 this->panel1->Name = L
"panel1";
553 this->panel1->Padding = System::Windows::Forms::Padding(0, 0, 0, 6);
554 this->panel1->Size = System::Drawing::Size(1328, 115);
555 this->panel1->TabIndex = 0;
559 this->buttonBrowseDiagLoggingTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
560 this->buttonBrowseDiagLoggingTraceFolder->Location = System::Drawing::Point(1298, 86);
561 this->buttonBrowseDiagLoggingTraceFolder->Name = L
"buttonBrowseDiagLoggingTraceFolder";
562 this->buttonBrowseDiagLoggingTraceFolder->Size = System::Drawing::Size(30, 23);
563 this->buttonBrowseDiagLoggingTraceFolder->TabIndex = 45;
564 this->buttonBrowseDiagLoggingTraceFolder->Text = L
"...";
565 this->buttonBrowseDiagLoggingTraceFolder->UseVisualStyleBackColor =
true;
566 this->buttonBrowseDiagLoggingTraceFolder->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonBrowseDiagLoggingTraceFolder_Click);
570 this->buttonOpenDiagLoggingTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
571 this->buttonOpenDiagLoggingTraceFolder->Location = System::Drawing::Point(1210, 86);
572 this->buttonOpenDiagLoggingTraceFolder->Name = L
"buttonOpenDiagLoggingTraceFolder";
573 this->buttonOpenDiagLoggingTraceFolder->Size = System::Drawing::Size(82, 23);
574 this->buttonOpenDiagLoggingTraceFolder->TabIndex = 44;
575 this->buttonOpenDiagLoggingTraceFolder->Text = L
"Open Folder";
576 this->buttonOpenDiagLoggingTraceFolder->UseVisualStyleBackColor =
true;
577 this->buttonOpenDiagLoggingTraceFolder->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonOpenDiagLoggingTraceFolder_Click);
581 this->textBoxDiagManagerTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
582 this->textBoxDiagManagerTraceFolder->Location = System::Drawing::Point(1095, 88);
583 this->textBoxDiagManagerTraceFolder->Name = L
"textBoxDiagManagerTraceFolder";
584 this->textBoxDiagManagerTraceFolder->Size = System::Drawing::Size(109, 20);
585 this->textBoxDiagManagerTraceFolder->TabIndex = 43;
586 this->textBoxDiagManagerTraceFolder->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxDiagManagerTraceFolder_TextChanged);
590 this->label19->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
591 this->label19->AutoSize =
true;
592 this->label19->Location = System::Drawing::Point(1073, 91);
593 this->label19->Name = L
"label19";
594 this->label19->Size = System::Drawing::Size(15, 13);
595 this->label19->TabIndex = 42;
596 this->label19->Text = L
"in";
600 this->comboBoxDiagLoggingTraceLevel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
601 this->comboBoxDiagLoggingTraceLevel->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
602 this->comboBoxDiagLoggingTraceLevel->Enabled =
false;
603 this->comboBoxDiagLoggingTraceLevel->FormattingEnabled =
true;
604 this->comboBoxDiagLoggingTraceLevel->Location = System::Drawing::Point(943, 88);
605 this->comboBoxDiagLoggingTraceLevel->Name = L
"comboBoxDiagLoggingTraceLevel";
606 this->comboBoxDiagLoggingTraceLevel->Size = System::Drawing::Size(124, 21);
607 this->comboBoxDiagLoggingTraceLevel->TabIndex = 41;
608 this->comboBoxDiagLoggingTraceLevel->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxDiagLoggingTraceLevel_SelectedValueChanged);
612 this->label17->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
613 this->label17->AutoSize =
true;
614 this->label17->Location = System::Drawing::Point(893, 91);
615 this->label17->Name = L
"label17";
616 this->label17->Size = System::Drawing::Size(44, 13);
617 this->label17->TabIndex = 40;
618 this->label17->Text = L
"at level:";
622 this->checkBoxIncludedDiagLogging->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
623 this->checkBoxIncludedDiagLogging->AutoSize =
true;
624 this->checkBoxIncludedDiagLogging->Location = System::Drawing::Point(760, 90);
625 this->checkBoxIncludedDiagLogging->Name = L
"checkBoxIncludedDiagLogging";
626 this->checkBoxIncludedDiagLogging->Size = System::Drawing::Size(129, 17);
627 this->checkBoxIncludedDiagLogging->TabIndex = 39;
628 this->checkBoxIncludedDiagLogging->Text = L
"included DiagLogging";
629 this->checkBoxIncludedDiagLogging->UseVisualStyleBackColor =
true;
630 this->checkBoxIncludedDiagLogging->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxIncludedDiagLogging_CheckedChanged);
634 this->comboBoxDiagManagerTraceLevel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
635 this->comboBoxDiagManagerTraceLevel->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
636 this->comboBoxDiagManagerTraceLevel->FormattingEnabled =
true;
637 this->comboBoxDiagManagerTraceLevel->Location = System::Drawing::Point(660, 88);
638 this->comboBoxDiagManagerTraceLevel->Name = L
"comboBoxDiagManagerTraceLevel";
639 this->comboBoxDiagManagerTraceLevel->Size = System::Drawing::Size(94, 21);
640 this->comboBoxDiagManagerTraceLevel->TabIndex = 38;
641 this->comboBoxDiagManagerTraceLevel->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxDiagManagerTraceLevel_SelectedValueChanged);
645 this->label16->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
646 this->label16->AutoSize =
true;
647 this->label16->Location = System::Drawing::Point(598, 91);
648 this->label16->Name = L
"label16";
649 this->label16->Size = System::Drawing::Size(59, 13);
650 this->label16->TabIndex = 37;
651 this->label16->Text = L
"trace level:";
655 this->textBoxDiagManagerLicenseKey->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
656 | System::Windows::Forms::AnchorStyles::Right));
657 this->textBoxDiagManagerLicenseKey->Location = System::Drawing::Point(128, 88);
658 this->textBoxDiagManagerLicenseKey->Name = L
"textBoxDiagManagerLicenseKey";
659 this->textBoxDiagManagerLicenseKey->PasswordChar =
'*';
660 this->textBoxDiagManagerLicenseKey->Size = System::Drawing::Size(456, 20);
661 this->textBoxDiagManagerLicenseKey->TabIndex = 36;
662 this->textBoxDiagManagerLicenseKey->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxDiagManagerLicenseKey_TextChanged);
663 this->textBoxDiagManagerLicenseKey->KeyDown +=
gcnew System::Windows::Forms::KeyEventHandler(
this, &SampleForm::textBoxDiagManagerLicenseKey_KeyDown);
667 this->label7->AutoSize =
true;
668 this->label7->Location = System::Drawing::Point(-3, 91);
669 this->label7->Name = L
"label7";
670 this->label7->Size = System::Drawing::Size(130, 13);
671 this->label7->TabIndex = 35;
672 this->label7->Text = L
"DiagManager license key:";
676 this->comboBoxDiagIpcType->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
677 this->comboBoxDiagIpcType->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
678 this->comboBoxDiagIpcType->FormattingEnabled =
true;
679 this->comboBoxDiagIpcType->Location = System::Drawing::Point(943, 61);
680 this->comboBoxDiagIpcType->Name = L
"comboBoxDiagIpcType";
681 this->comboBoxDiagIpcType->Size = System::Drawing::Size(93, 21);
682 this->comboBoxDiagIpcType->TabIndex = 34;
683 this->comboBoxDiagIpcType->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxDiagIpcType_SelectedValueChanged);
687 this->labelDiagType->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
688 this->labelDiagType->AutoSize =
true;
689 this->labelDiagType->Location = System::Drawing::Point(878, 65);
690 this->labelDiagType->Name = L
"labelDiagType";
691 this->labelDiagType->Size = System::Drawing::Size(59, 13);
692 this->labelDiagType->TabIndex = 33;
693 this->labelDiagType->Text = L
"Diag Type:";
697 this->labelOdxProject->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
698 this->labelOdxProject->AutoSize =
true;
699 this->labelOdxProject->Location = System::Drawing::Point(1046, 35);
700 this->labelOdxProject->Name = L
"labelOdxProject";
701 this->labelOdxProject->Size = System::Drawing::Size(43, 13);
702 this->labelOdxProject->TabIndex = 32;
703 this->labelOdxProject->Text = L
"Project:";
707 this->labelODXVehicle->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
708 this->labelODXVehicle->AutoSize =
true;
709 this->labelODXVehicle->Location = System::Drawing::Point(1044, 65);
710 this->labelODXVehicle->Name = L
"labelODXVehicle";
711 this->labelODXVehicle->Size = System::Drawing::Size(45, 13);
712 this->labelODXVehicle->TabIndex = 31;
713 this->labelODXVehicle->Text = L
"Vehicle:";
717 this->comboBoxODXVehicle->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
718 this->comboBoxODXVehicle->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
719 this->comboBoxODXVehicle->DropDownWidth = 120;
720 this->comboBoxODXVehicle->FormattingEnabled =
true;
721 this->comboBoxODXVehicle->Location = System::Drawing::Point(1095, 61);
722 this->comboBoxODXVehicle->Name = L
"comboBoxODXVehicle";
723 this->comboBoxODXVehicle->Size = System::Drawing::Size(233, 21);
724 this->comboBoxODXVehicle->TabIndex = 3;
725 this->comboBoxODXVehicle->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxODXVehicle_SelectedValueChanged);
729 this->comboBoxODXProject->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
730 this->comboBoxODXProject->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
731 this->comboBoxODXProject->DropDownWidth = 200;
732 this->comboBoxODXProject->FormattingEnabled =
true;
733 this->comboBoxODXProject->Location = System::Drawing::Point(1095, 31);
734 this->comboBoxODXProject->Name = L
"comboBoxODXProject";
735 this->comboBoxODXProject->Size = System::Drawing::Size(233, 21);
736 this->comboBoxODXProject->TabIndex = 4;
737 this->comboBoxODXProject->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxODXProject_SelectedValueChanged);
741 this->label2->AutoSize =
true;
742 this->label2->Location = System::Drawing::Point(165, 34);
743 this->label2->Name = L
"label2";
744 this->label2->Size = System::Drawing::Size(54, 13);
745 this->label2->TabIndex = 30;
746 this->label2->Text = L
"Files, Size";
750 this->textBoxTraceFileMaxSize->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
751 this->textBoxTraceFileMaxSize->Location = System::Drawing::Point(256, 30);
752 this->textBoxTraceFileMaxSize->Name = L
"textBoxTraceFileMaxSize";
753 this->textBoxTraceFileMaxSize->Size = System::Drawing::Size(32, 22);
754 this->textBoxTraceFileMaxSize->TabIndex = 29;
755 this->textBoxTraceFileMaxSize->Text = L
"100";
756 this->textBoxTraceFileMaxSize->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
757 this->textBoxTraceFileMaxSize->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxTraceFileMaxSize_TextChanged);
761 this->textBoxTraceFileMaxCount->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
762 this->textBoxTraceFileMaxCount->Location = System::Drawing::Point(225, 30);
763 this->textBoxTraceFileMaxCount->Name = L
"textBoxTraceFileMaxCount";
764 this->textBoxTraceFileMaxCount->Size = System::Drawing::Size(25, 22);
765 this->textBoxTraceFileMaxCount->TabIndex = 28;
766 this->textBoxTraceFileMaxCount->Text = L
"10";
767 this->textBoxTraceFileMaxCount->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
768 this->textBoxTraceFileMaxCount->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxTraceFileMaxCount_TextChanged);
772 this->buttonOpenTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
773 this->buttonOpenTraceFolder->Location = System::Drawing::Point(833, 30);
774 this->buttonOpenTraceFolder->Name = L
"buttonOpenTraceFolder";
775 this->buttonOpenTraceFolder->Size = System::Drawing::Size(49, 23);
776 this->buttonOpenTraceFolder->TabIndex = 15;
777 this->buttonOpenTraceFolder->Text = L
"Open...";
778 this->buttonOpenTraceFolder->UseVisualStyleBackColor =
true;
779 this->buttonOpenTraceFolder->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonOpenTraceFolder_Click);
783 this->textBoxRuntimeContextName->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
784 this->textBoxRuntimeContextName->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
785 this->textBoxRuntimeContextName->Location = System::Drawing::Point(1124, 2);
786 this->textBoxRuntimeContextName->Name = L
"textBoxRuntimeContextName";
787 this->textBoxRuntimeContextName->Size = System::Drawing::Size(123, 22);
788 this->textBoxRuntimeContextName->TabIndex = 8;
789 this->textBoxRuntimeContextName->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxRuntimeContextName_TextChanged);
793 this->runtimeNameLabel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
794 this->runtimeNameLabel->AutoSize =
true;
795 this->runtimeNameLabel->Location = System::Drawing::Point(1044, 5);
796 this->runtimeNameLabel->Name = L
"runtimeNameLabel";
797 this->runtimeNameLabel->Size = System::Drawing::Size(75, 13);
798 this->runtimeNameLabel->TabIndex = 7;
799 this->runtimeNameLabel->Text = L
"Runtime name";
803 this->textBoxDiagPortPipe->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
804 this->textBoxDiagPortPipe->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
805 static_cast<System::Byte
>(0)));
806 this->textBoxDiagPortPipe->Location = System::Drawing::Point(1273, 31);
807 this->textBoxDiagPortPipe->Name = L
"textBoxDiagPortPipe";
808 this->textBoxDiagPortPipe->Size = System::Drawing::Size(55, 22);
809 this->textBoxDiagPortPipe->TabIndex = 22;
810 this->textBoxDiagPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
814 this->textBoxRtPortPipe->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
815 this->textBoxRtPortPipe->BackColor = System::Drawing::SystemColors::Window;
816 this->textBoxRtPortPipe->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
817 static_cast<System::Byte
>(0)));
818 this->textBoxRtPortPipe->Location = System::Drawing::Point(1192, 31);
819 this->textBoxRtPortPipe->Name = L
"textBoxRtPortPipe";
820 this->textBoxRtPortPipe->Size = System::Drawing::Size(55, 22);
821 this->textBoxRtPortPipe->TabIndex = 20;
822 this->textBoxRtPortPipe->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPortPipe_TextChanged);
826 this->label13->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
827 this->label13->AutoSize =
true;
828 this->label13->Location = System::Drawing::Point(1254, 34);
829 this->label13->Name = L
"label13";
830 this->label13->Size = System::Drawing::Size(12, 13);
831 this->label13->TabIndex = 21;
832 this->label13->Text = L
"/";
836 this->portPipeLabel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
837 this->portPipeLabel->AutoSize =
true;
838 this->portPipeLabel->Location = System::Drawing::Point(1044, 34);
839 this->portPipeLabel->Name = L
"portPipeLabel";
840 this->portPipeLabel->Size = System::Drawing::Size(144, 13);
841 this->portPipeLabel->TabIndex = 19;
842 this->portPipeLabel->Text = L
"Runner / DiagManager Ports";
846 this->comboBoxIpcType->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
847 this->comboBoxIpcType->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
848 this->comboBoxIpcType->DropDownWidth = 170;
849 this->comboBoxIpcType->FormattingEnabled =
true;
850 this->comboBoxIpcType->Location = System::Drawing::Point(943, 31);
851 this->comboBoxIpcType->Name = L
"comboBoxIpcType";
852 this->comboBoxIpcType->Size = System::Drawing::Size(93, 21);
853 this->comboBoxIpcType->TabIndex = 18;
854 this->comboBoxIpcType->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxIpcType_SelectedValueChanged);
858 this->label11->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
859 this->label11->AutoSize =
true;
860 this->label11->Location = System::Drawing::Point(895, 34);
861 this->label11->Name = L
"label11";
862 this->label11->Size = System::Drawing::Size(24, 13);
863 this->label11->TabIndex = 17;
864 this->label11->Text = L
"IPC";
868 this->label10->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
869 this->label10->BackColor = System::Drawing::SystemColors::ControlDark;
870 this->label10->Location = System::Drawing::Point(888, 35);
871 this->label10->Name = L
"label10";
872 this->label10->Size = System::Drawing::Size(1, 14);
873 this->label10->TabIndex = 16;
877 this->buttonBrowseTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
878 this->buttonBrowseTraceFolder->Location = System::Drawing::Point(798, 30);
879 this->buttonBrowseTraceFolder->Name = L
"buttonBrowseTraceFolder";
880 this->buttonBrowseTraceFolder->Size = System::Drawing::Size(29, 23);
881 this->buttonBrowseTraceFolder->TabIndex = 14;
882 this->buttonBrowseTraceFolder->Text = L
"...";
883 this->buttonBrowseTraceFolder->UseVisualStyleBackColor =
true;
884 this->buttonBrowseTraceFolder->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonBrowseTraceFolder_Click);
888 this->textBoxTraceFolder->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
889 | System::Windows::Forms::AnchorStyles::Right));
890 this->textBoxTraceFolder->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
891 static_cast<System::Byte
>(0)));
892 this->textBoxTraceFolder->Location = System::Drawing::Point(306, 30);
893 this->textBoxTraceFolder->Name = L
"textBoxTraceFolder";
894 this->textBoxTraceFolder->Size = System::Drawing::Size(486, 22);
895 this->textBoxTraceFolder->TabIndex = 13;
896 this->textBoxTraceFolder->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxTraceFolder_TextChanged);
900 this->label9->AutoSize =
true;
901 this->label9->Location = System::Drawing::Point(291, 35);
902 this->label9->Name = L
"label9";
903 this->label9->Size = System::Drawing::Size(15, 13);
904 this->label9->TabIndex = 12;
905 this->label9->Text = L
"in";
909 this->comboBoxTraceLevel->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
910 this->comboBoxTraceLevel->FormattingEnabled =
true;
911 this->comboBoxTraceLevel->Location = System::Drawing::Point(90, 31);
912 this->comboBoxTraceLevel->Name = L
"comboBoxTraceLevel";
913 this->comboBoxTraceLevel->Size = System::Drawing::Size(69, 21);
914 this->comboBoxTraceLevel->TabIndex = 11;
915 this->comboBoxTraceLevel->SelectedIndexChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxTraceLevel_SelectedIndexChanged);
916 this->comboBoxTraceLevel->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::comboBoxTraceLevel_SelectedValueChanged);
920 this->label8->AutoSize =
true;
921 this->label8->Location = System::Drawing::Point(-3, 34);
922 this->label8->Name = L
"label8";
923 this->label8->Size = System::Drawing::Size(83, 13);
924 this->label8->TabIndex = 10;
925 this->label8->Text = L
"TraceFile: Level";
929 this->label6->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
930 | System::Windows::Forms::AnchorStyles::Right));
931 this->label6->BackColor = System::Drawing::SystemColors::ControlDark;
932 this->label6->Location = System::Drawing::Point(-3, 27);
933 this->label6->Name = L
"label6";
934 this->label6->Size = System::Drawing::Size(1332, 1);
935 this->label6->TabIndex = 9;
939 this->buttonReload->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
940 this->buttonReload->Enabled =
false;
941 this->buttonReload->Location = System::Drawing::Point(833, 1);
942 this->buttonReload->Name = L
"buttonReload";
943 this->buttonReload->Size = System::Drawing::Size(49, 23);
944 this->buttonReload->TabIndex = 3;
945 this->buttonReload->Text = L
"Reload";
946 this->buttonReload->UseVisualStyleBackColor =
true;
947 this->buttonReload->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonReload_Click);
951 this->txtPassword->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
952 this->txtPassword->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
953 static_cast<System::Byte
>(0)));
954 this->txtPassword->Location = System::Drawing::Point(943, 2);
955 this->txtPassword->Name = L
"txtPassword";
956 this->txtPassword->PasswordChar =
'*';
957 this->txtPassword->Size = System::Drawing::Size(93, 22);
958 this->txtPassword->TabIndex = 5;
959 this->txtPassword->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::txtPassword_TextChanged);
963 this->passwordLabel->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
964 this->passwordLabel->AutoSize =
true;
965 this->passwordLabel->Location = System::Drawing::Point(884, 6);
966 this->passwordLabel->Name = L
"passwordLabel";
967 this->passwordLabel->Size = System::Drawing::Size(53, 13);
968 this->passwordLabel->TabIndex = 4;
969 this->passwordLabel->Text = L
"Password";
973 this->buttonBrowseFile->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
974 this->buttonBrowseFile->Location = System::Drawing::Point(798, 1);
975 this->buttonBrowseFile->Name = L
"buttonBrowseFile";
976 this->buttonBrowseFile->Size = System::Drawing::Size(29, 23);
977 this->buttonBrowseFile->TabIndex = 2;
978 this->buttonBrowseFile->Text = L
"...";
979 this->buttonBrowseFile->UseVisualStyleBackColor =
true;
980 this->buttonBrowseFile->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonBrowseFile_Click);
984 this->cbFilePath->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
985 | System::Windows::Forms::AnchorStyles::Right));
986 this->cbFilePath->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
987 static_cast<System::Byte
>(0)));
988 this->cbFilePath->Location = System::Drawing::Point(90, 1);
989 this->cbFilePath->Name = L
"cbFilePath";
990 this->cbFilePath->Size = System::Drawing::Size(702, 22);
991 this->cbFilePath->TabIndex = 1;
992 this->cbFilePath->SelectedValueChanged +=
gcnew System::EventHandler(
this, &SampleForm::cbFilePath_SelectedValueChanged);
993 this->cbFilePath->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::cbFilePath_TextChanged);
997 this->label1->AutoSize =
true;
998 this->label1->Location = System::Drawing::Point(-3, 6);
999 this->label1->Name = L
"label1";
1000 this->label1->Size = System::Drawing::Size(87, 13);
1001 this->label1->TabIndex = 0;
1002 this->label1->Text = L
"Select PTX/PPX";
1006 this->textBoxTimeout->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
1007 this->textBoxTimeout->Location = System::Drawing::Point(642, 3);
1008 this->textBoxTimeout->Name = L
"textBoxTimeout";
1009 this->textBoxTimeout->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
1010 this->textBoxTimeout->Size = System::Drawing::Size(45, 22);
1011 this->textBoxTimeout->TabIndex = 4;
1012 this->textBoxTimeout->Text = L
"0";
1013 this->textBoxTimeout->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxTimeout_TextChanged);
1017 this->labelTimeout->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1018 this->labelTimeout->AutoSize =
true;
1019 this->labelTimeout->Location = System::Drawing::Point(591, 0);
1020 this->labelTimeout->Name = L
"labelTimeout";
1021 this->labelTimeout->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
1022 this->labelTimeout->Size = System::Drawing::Size(45, 20);
1023 this->labelTimeout->TabIndex = 3;
1024 this->labelTimeout->Text = L
"Timeout";
1028 this->textBoxVoltageThreshold->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1029 static_cast<System::Byte
>(0)));
1030 this->textBoxVoltageThreshold->Location = System::Drawing::Point(1301, 3);
1031 this->textBoxVoltageThreshold->Name = L
"textBoxVoltageThreshold";
1032 this->textBoxVoltageThreshold->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
1033 this->textBoxVoltageThreshold->Size = System::Drawing::Size(45, 22);
1034 this->textBoxVoltageThreshold->TabIndex = 16;
1035 this->textBoxVoltageThreshold->Text = L
"6000";
1036 this->textBoxVoltageThreshold->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxBatteryVoltageThreshold_TextChanged);
1040 this->labelVoltageThreshold->AutoSize =
true;
1041 this->labelVoltageThreshold->Location = System::Drawing::Point(1205, 0);
1042 this->labelVoltageThreshold->Name = L
"labelVoltageThreshold";
1043 this->labelVoltageThreshold->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
1044 this->labelVoltageThreshold->Size = System::Drawing::Size(90, 20);
1045 this->labelVoltageThreshold->TabIndex = 15;
1046 this->labelVoltageThreshold->Text = L
"VoltageThreshold";
1050 this->textBoxPollingTime->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1051 static_cast<System::Byte
>(0)));
1052 this->textBoxPollingTime->Location = System::Drawing::Point(1159, 3);
1053 this->textBoxPollingTime->Name = L
"textBoxPollingTime";
1054 this->textBoxPollingTime->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
1055 this->textBoxPollingTime->Size = System::Drawing::Size(40, 22);
1056 this->textBoxPollingTime->TabIndex = 14;
1057 this->textBoxPollingTime->Text = L
"500";
1058 this->textBoxPollingTime->TextChanged +=
gcnew System::EventHandler(
this, &SampleForm::textBoxPollingTime_TextChanged);
1062 this->labelPollingTime->AutoSize =
true;
1063 this->labelPollingTime->Location = System::Drawing::Point(1092, 0);
1064 this->labelPollingTime->Name = L
"labelPollingTime";
1065 this->labelPollingTime->Padding = System::Windows::Forms::Padding(0, 7, 0, 0);
1066 this->labelPollingTime->Size = System::Drawing::Size(61, 20);
1067 this->labelPollingTime->TabIndex = 13;
1068 this->labelPollingTime->Text = L
"PollingTime";
1072 this->checkBoxIgnition->AutoSize =
true;
1073 this->checkBoxIgnition->Checked =
true;
1074 this->checkBoxIgnition->CheckState = System::Windows::Forms::CheckState::Indeterminate;
1075 this->checkBoxIgnition->Location = System::Drawing::Point(978, 3);
1076 this->checkBoxIgnition->Name = L
"checkBoxIgnition";
1077 this->checkBoxIgnition->Padding = System::Windows::Forms::Padding(0, 3, 0, 0);
1078 this->checkBoxIgnition->Size = System::Drawing::Size(45, 20);
1079 this->checkBoxIgnition->TabIndex = 10;
1080 this->checkBoxIgnition->Text = L
"IGN";
1081 this->checkBoxIgnition->TextImageRelation = System::Windows::Forms::TextImageRelation::TextBeforeImage;
1082 this->checkBoxIgnition->ThreeState =
true;
1083 this->checkBoxIgnition->UseVisualStyleBackColor =
true;
1084 this->checkBoxIgnition->CheckStateChanged +=
gcnew System::EventHandler(
this, &SampleForm::CheckBoxKL15_CheckStateChanged);
1088 this->checkBoxUseConnectionState->AutoSize =
true;
1089 this->checkBoxUseConnectionState->CheckAlign = System::Drawing::ContentAlignment::MiddleRight;
1090 this->checkBoxUseConnectionState->Location = System::Drawing::Point(700, 3);
1091 this->checkBoxUseConnectionState->Name = L
"checkBoxUseConnectionState";
1092 this->checkBoxUseConnectionState->Padding = System::Windows::Forms::Padding(0, 3, 0, 0);
1093 this->checkBoxUseConnectionState->Size = System::Drawing::Size(139, 20);
1094 this->checkBoxUseConnectionState->TabIndex = 6;
1095 this->checkBoxUseConnectionState->Text = L
"Check ConnectionState";
1096 this->checkBoxUseConnectionState->UseVisualStyleBackColor =
true;
1097 this->checkBoxUseConnectionState->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxUseConnectionState_CheckedChanged);
1101 this->panel2->Controls->Add(this->buttonLicense);
1102 this->panel2->Controls->Add(this->buttonStartStopWebServer);
1103 this->panel2->Controls->Add(this->buttonHmi);
1104 this->panel2->Controls->Add(this->checkBoxNewRuntimeManager);
1105 this->panel2->Controls->Add(this->label15);
1106 this->panel2->Controls->Add(this->label14);
1107 this->panel2->Controls->Add(this->checkBoxCyclicReload);
1108 this->panel2->Controls->Add(this->listBoxOuput);
1109 this->panel2->Controls->Add(this->labelOutputOverflow);
1110 this->panel2->Controls->Add(this->buttonCopyRow);
1111 this->panel2->Controls->Add(this->buttonClearOutput);
1112 this->panel2->Controls->Add(this->buttonNewInstanceNewThread);
1113 this->panel2->Controls->Add(this->buttonNewInstance);
1114 this->panel2->Controls->Add(this->checkBoxStartAllParents);
1115 this->panel2->Controls->Add(this->checkBoxAdd2Output);
1116 this->panel2->Controls->Add(this->checkBoxCyclicExecution);
1117 this->panel2->Controls->Add(this->checkBoxAsyncExecution);
1118 this->panel2->Controls->Add(this->buttonPause);
1119 this->panel2->Controls->Add(this->buttonStop);
1120 this->panel2->Controls->Add(this->buttonExecuteMain);
1121 this->panel2->Controls->Add(this->buttonExecuteSelectedProcedure);
1122 this->panel2->Dock = System::Windows::Forms::DockStyle::Fill;
1123 this->panel2->Location = System::Drawing::Point(0, 0);
1124 this->panel2->Name = L
"panel2";
1125 this->panel2->Size = System::Drawing::Size(1328, 305);
1126 this->panel2->TabIndex = 0;
1130 this->buttonLicense->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1131 this->buttonLicense->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonLicense.Image")));
1132 this->buttonLicense->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1133 this->buttonLicense->Location = System::Drawing::Point(798, 5);
1134 this->buttonLicense->Name = L
"buttonLicense";
1135 this->buttonLicense->Padding = System::Windows::Forms::Padding(10, 0, 5, 0);
1136 this->buttonLicense->Size = System::Drawing::Size(91, 35);
1137 this->buttonLicense->TabIndex = 19;
1138 this->buttonLicense->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/3333D311.htm";
1139 this->buttonLicense->Text = L
"License";
1140 this->buttonLicense->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1141 this->buttonLicense->UseVisualStyleBackColor =
true;
1142 this->buttonLicense->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonLicense_Click);
1146 this->buttonStartStopWebServer->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1147 this->buttonStartStopWebServer->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonStartStopWebServer.Image")));
1148 this->buttonStartStopWebServer->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1149 this->buttonStartStopWebServer->Location = System::Drawing::Point(676, 5);
1150 this->buttonStartStopWebServer->Name = L
"buttonStartStopWebServer";
1151 this->buttonStartStopWebServer->Padding = System::Windows::Forms::Padding(10, 0, 5, 0);
1152 this->buttonStartStopWebServer->Size = System::Drawing::Size(116, 35);
1153 this->buttonStartStopWebServer->TabIndex = 18;
1154 this->buttonStartStopWebServer->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/3333D311.htm";
1155 this->buttonStartStopWebServer->Text = L
"Web Server";
1156 this->buttonStartStopWebServer->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1157 this->buttonStartStopWebServer->UseVisualStyleBackColor =
true;
1158 this->buttonStartStopWebServer->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonStartStopWebServer_Click);
1162 this->buttonHmi->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1163 this->buttonHmi->Appearance = System::Windows::Forms::Appearance::Button;
1164 this->buttonHmi->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonHmi.Image")));
1165 this->buttonHmi->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1166 this->buttonHmi->Location = System::Drawing::Point(895, 5);
1167 this->buttonHmi->Name = L
"buttonHmi";
1168 this->buttonHmi->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1169 this->buttonHmi->Size = System::Drawing::Size(80, 35);
1170 this->buttonHmi->TabIndex = 9;
1171 this->buttonHmi->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/18FE2C39.htm";
1172 this->buttonHmi->Text = L
"HMI";
1173 this->buttonHmi->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1174 this->buttonHmi->UseVisualStyleBackColor =
true;
1175 this->buttonHmi->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::buttonHmi_Click);
1179 this->checkBoxNewRuntimeManager->AutoSize =
true;
1180 this->checkBoxNewRuntimeManager->Enabled =
false;
1181 this->checkBoxNewRuntimeManager->Location = System::Drawing::Point(481, 7);
1182 this->checkBoxNewRuntimeManager->Name = L
"checkBoxNewRuntimeManager";
1183 this->checkBoxNewRuntimeManager->Size = System::Drawing::Size(89, 17);
1184 this->checkBoxNewRuntimeManager->TabIndex = 7;
1185 this->checkBoxNewRuntimeManager->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/A42F362A.htm";
1186 this->checkBoxNewRuntimeManager->Text = L
"New RntMgr.";
1187 this->checkBoxNewRuntimeManager->UseVisualStyleBackColor =
true;
1188 this->checkBoxNewRuntimeManager->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxNewRuntimeManager_CheckedChanged);
1192 this->label15->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
1193 | System::Windows::Forms::AnchorStyles::Right));
1194 this->label15->BackColor = System::Drawing::SystemColors::ControlDark;
1195 this->label15->Location = System::Drawing::Point(3, 43);
1196 this->label15->Name = L
"label15";
1197 this->label15->Size = System::Drawing::Size(1328, 1);
1198 this->label15->TabIndex = 12;
1202 this->label14->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
1203 | System::Windows::Forms::AnchorStyles::Right));
1204 this->label14->BackColor = System::Drawing::SystemColors::ControlDark;
1205 this->label14->Location = System::Drawing::Point(1, 1);
1206 this->label14->Name = L
"label14";
1207 this->label14->Size = System::Drawing::Size(1328, 1);
1208 this->label14->TabIndex = 0;
1212 this->checkBoxCyclicReload->AutoSize =
true;
1213 this->checkBoxCyclicReload->Enabled =
false;
1214 this->checkBoxCyclicReload->Location = System::Drawing::Point(481, 23);
1215 this->checkBoxCyclicReload->Name = L
"checkBoxCyclicReload";
1216 this->checkBoxCyclicReload->Size = System::Drawing::Size(91, 17);
1217 this->checkBoxCyclicReload->TabIndex = 8;
1218 this->checkBoxCyclicReload->Text = L
"Cyclic Reload";
1219 this->checkBoxCyclicReload->UseVisualStyleBackColor =
true;
1220 this->checkBoxCyclicReload->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxCyclicReload_CheckedChanged);
1224 this->listBoxOuput->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
1225 | System::Windows::Forms::AnchorStyles::Left)
1226 | System::Windows::Forms::AnchorStyles::Right));
1227 this->listBoxOuput->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1228 static_cast<System::Byte
>(0)));
1229 this->listBoxOuput->HorizontalScrollbar =
true;
1230 this->listBoxOuput->IntegralHeight =
false;
1231 this->listBoxOuput->ItemHeight = 14;
1232 this->listBoxOuput->Location = System::Drawing::Point(0, 76);
1233 this->listBoxOuput->Name = L
"listBoxOuput";
1234 this->listBoxOuput->SelectionMode = System::Windows::Forms::SelectionMode::MultiExtended;
1235 this->listBoxOuput->Size = System::Drawing::Size(1328, 81);
1236 this->listBoxOuput->TabIndex = 17;
1237 this->listBoxOuput->SelectedIndexChanged +=
gcnew System::EventHandler(
this, &SampleForm::listBoxOuput_SelectedIndexChanged);
1241 this->labelOutputOverflow->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1242 this->labelOutputOverflow->AutoSize =
true;
1243 this->labelOutputOverflow->ForeColor = System::Drawing::Color::DarkRed;
1244 this->labelOutputOverflow->Location = System::Drawing::Point(781, 53);
1245 this->labelOutputOverflow->Name = L
"labelOutputOverflow";
1246 this->labelOutputOverflow->Size = System::Drawing::Size(345, 13);
1247 this->labelOutputOverflow->TabIndex = 14;
1248 this->labelOutputOverflow->Text = L
"More than 7,500 lines are in output! After 10,000 all lines will be cleared!";
1249 this->labelOutputOverflow->Visible =
false;
1253 this->buttonCopyRow->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1254 this->buttonCopyRow->Enabled =
false;
1255 this->buttonCopyRow->Location = System::Drawing::Point(1132, 48);
1256 this->buttonCopyRow->Name = L
"buttonCopyRow";
1257 this->buttonCopyRow->Size = System::Drawing::Size(86, 23);
1258 this->buttonCopyRow->TabIndex = 15;
1259 this->buttonCopyRow->Text = L
"Copy";
1260 this->buttonCopyRow->UseVisualStyleBackColor =
true;
1261 this->buttonCopyRow->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonCopyRow_Click);
1265 this->buttonClearOutput->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1266 this->buttonClearOutput->Location = System::Drawing::Point(1224, 48);
1267 this->buttonClearOutput->Name = L
"buttonClearOutput";
1268 this->buttonClearOutput->Size = System::Drawing::Size(104, 23);
1269 this->buttonClearOutput->TabIndex = 16;
1270 this->buttonClearOutput->Text = L
"Clear Output";
1271 this->buttonClearOutput->UseVisualStyleBackColor =
true;
1272 this->buttonClearOutput->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonClearOutput_Click);
1276 this->buttonNewInstanceNewThread->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1277 this->buttonNewInstanceNewThread->AutoSize =
true;
1278 this->buttonNewInstanceNewThread->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonNewInstanceNewThread.Image")));
1279 this->buttonNewInstanceNewThread->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1280 this->buttonNewInstanceNewThread->Location = System::Drawing::Point(1116, 5);
1281 this->buttonNewInstanceNewThread->Name = L
"buttonNewInstanceNewThread";
1282 this->buttonNewInstanceNewThread->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1283 this->buttonNewInstanceNewThread->Size = System::Drawing::Size(212, 35);
1284 this->buttonNewInstanceNewThread->TabIndex = 11;
1285 this->buttonNewInstanceNewThread->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/18FE2C39.htm";
1286 this->buttonNewInstanceNewThread->Text = L
"New Instance - New Thread";
1287 this->buttonNewInstanceNewThread->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1288 this->buttonNewInstanceNewThread->UseVisualStyleBackColor =
true;
1289 this->buttonNewInstanceNewThread->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonNewInstanceNewThread_Click);
1293 this->buttonNewInstance->Anchor =
static_cast<System::Windows::Forms::AnchorStyles
>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
1294 this->buttonNewInstance->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonNewInstance.Image")));
1295 this->buttonNewInstance->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1296 this->buttonNewInstance->Location = System::Drawing::Point(981, 5);
1297 this->buttonNewInstance->Name = L
"buttonNewInstance";
1298 this->buttonNewInstance->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1299 this->buttonNewInstance->Size = System::Drawing::Size(129, 35);
1300 this->buttonNewInstance->TabIndex = 10;
1301 this->buttonNewInstance->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/18FE2C39.htm";
1302 this->buttonNewInstance->Text = L
"New Instance";
1303 this->buttonNewInstance->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1304 this->buttonNewInstance->UseVisualStyleBackColor =
true;
1305 this->buttonNewInstance->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonNewInstance_Click);
1309 this->checkBoxStartAllParents->AutoSize =
true;
1310 this->checkBoxStartAllParents->Location = System::Drawing::Point(149, 51);
1311 this->checkBoxStartAllParents->Name = L
"checkBoxStartAllParents";
1312 this->checkBoxStartAllParents->Size = System::Drawing::Size(106, 17);
1313 this->checkBoxStartAllParents->TabIndex = 12;
1314 this->checkBoxStartAllParents->Tag = L
"";
1315 this->checkBoxStartAllParents->Text = L
"Sync with Parent";
1316 this->checkBoxStartAllParents->UseVisualStyleBackColor =
true;
1317 this->checkBoxStartAllParents->Visible =
false;
1321 this->checkBoxAdd2Output->AutoSize =
true;
1322 this->checkBoxAdd2Output->Checked =
true;
1323 this->checkBoxAdd2Output->CheckState = System::Windows::Forms::CheckState::Checked;
1324 this->checkBoxAdd2Output->Location = System::Drawing::Point(0, 51);
1325 this->checkBoxAdd2Output->Name = L
"checkBoxAdd2Output";
1326 this->checkBoxAdd2Output->Size = System::Drawing::Size(143, 17);
1327 this->checkBoxAdd2Output->TabIndex = 13;
1328 this->checkBoxAdd2Output->Tag = L
"";
1329 this->checkBoxAdd2Output->Text = L
"Add Messages to Output";
1330 this->checkBoxAdd2Output->UseVisualStyleBackColor =
true;
1331 this->checkBoxAdd2Output->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxAdd2Output_CheckedChanged);
1335 this->checkBoxCyclicExecution->AutoSize =
true;
1336 this->checkBoxCyclicExecution->Location = System::Drawing::Point(405, 23);
1337 this->checkBoxCyclicExecution->Name = L
"checkBoxCyclicExecution";
1338 this->checkBoxCyclicExecution->Size = System::Drawing::Size(54, 17);
1339 this->checkBoxCyclicExecution->TabIndex = 6;
1340 this->checkBoxCyclicExecution->Tag = L
"";
1341 this->checkBoxCyclicExecution->Text = L
"Cyclic";
1342 this->checkBoxCyclicExecution->UseVisualStyleBackColor =
true;
1343 this->checkBoxCyclicExecution->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxCyclicExecution_CheckedChanged);
1347 this->checkBoxAsyncExecution->AutoSize =
true;
1348 this->checkBoxAsyncExecution->Checked =
true;
1349 this->checkBoxAsyncExecution->CheckState = System::Windows::Forms::CheckState::Checked;
1350 this->checkBoxAsyncExecution->Location = System::Drawing::Point(405, 7);
1351 this->checkBoxAsyncExecution->Name = L
"checkBoxAsyncExecution";
1352 this->checkBoxAsyncExecution->Size = System::Drawing::Size(76, 17);
1353 this->checkBoxAsyncExecution->TabIndex = 5;
1354 this->checkBoxAsyncExecution->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/A42F362A.htm";
1355 this->checkBoxAsyncExecution->Text = L
"Asynchron";
1356 this->checkBoxAsyncExecution->UseVisualStyleBackColor =
true;
1357 this->checkBoxAsyncExecution->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::checkBoxAsyncExecution_CheckedChanged);
1361 this->buttonPause->Appearance = System::Windows::Forms::Appearance::Button;
1362 this->buttonPause->Enabled =
false;
1363 this->buttonPause->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonPause.Image")));
1364 this->buttonPause->Location = System::Drawing::Point(263, 5);
1365 this->buttonPause->Name = L
"buttonPause";
1366 this->buttonPause->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1367 this->buttonPause->Size = System::Drawing::Size(42, 35);
1368 this->buttonPause->TabIndex = 3;
1369 this->buttonPause->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/3333D311.htm";
1370 this->buttonPause->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1371 this->buttonPause->UseVisualStyleBackColor =
true;
1372 this->buttonPause->CheckedChanged +=
gcnew System::EventHandler(
this, &SampleForm::buttonPause_Click);
1376 this->buttonStop->Enabled =
false;
1377 this->buttonStop->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonStop.Image")));
1378 this->buttonStop->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1379 this->buttonStop->Location = System::Drawing::Point(311, 5);
1380 this->buttonStop->Name = L
"buttonStop";
1381 this->buttonStop->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1382 this->buttonStop->Size = System::Drawing::Size(88, 35);
1383 this->buttonStop->TabIndex = 4;
1384 this->buttonStop->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/3333D311.htm";
1385 this->buttonStop->Text = L
"Stop";
1386 this->buttonStop->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1387 this->buttonStop->UseVisualStyleBackColor =
true;
1388 this->buttonStop->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonStop_Click);
1392 this->buttonExecuteMain->Enabled =
false;
1393 this->buttonExecuteMain->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonExecuteMain.Image")));
1394 this->buttonExecuteMain->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1395 this->buttonExecuteMain->Location = System::Drawing::Point(0, 5);
1396 this->buttonExecuteMain->Name = L
"buttonExecuteMain";
1397 this->buttonExecuteMain->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1398 this->buttonExecuteMain->Size = System::Drawing::Size(91, 35);
1399 this->buttonExecuteMain->TabIndex = 1;
1400 this->buttonExecuteMain->Text = L
"Main";
1401 this->buttonExecuteMain->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1402 this->buttonExecuteMain->UseVisualStyleBackColor =
true;
1403 this->buttonExecuteMain->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonExecuteMain_Click);
1407 this->buttonExecuteSelectedProcedure->Enabled =
false;
1408 this->buttonExecuteSelectedProcedure->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L
"buttonExecuteSelectedProcedure.Image")));
1409 this->buttonExecuteSelectedProcedure->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
1410 this->buttonExecuteSelectedProcedure->Location = System::Drawing::Point(97, 5);
1411 this->buttonExecuteSelectedProcedure->Name = L
"buttonExecuteSelectedProcedure";
1412 this->buttonExecuteSelectedProcedure->Padding = System::Windows::Forms::Padding(10, 0, 10, 0);
1413 this->buttonExecuteSelectedProcedure->Size = System::Drawing::Size(160, 35);
1414 this->buttonExecuteSelectedProcedure->TabIndex = 2;
1415 this->buttonExecuteSelectedProcedure->Text = L
"Selected Procedure";
1416 this->buttonExecuteSelectedProcedure->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
1417 this->buttonExecuteSelectedProcedure->UseVisualStyleBackColor =
true;
1418 this->buttonExecuteSelectedProcedure->Click +=
gcnew System::EventHandler(
this, &SampleForm::buttonExecuteSelectedProcedure_Click);
1422 this->openFileDialog1->Filter = L
"All supported formats(*.ptx, *.ppx)|*.ptx;*.ppx|PTX Files(*.ptx)|*.ptx|PPX Files("
1423 L
"*->ppx)|*->ppx|All Files (*->*)|*->*";
1424 this->openFileDialog1->Title = L
"Please select a PTX/PPX file";
1428 this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
1429 this->splitContainer1->FixedPanel = System::Windows::Forms::FixedPanel::Panel1;
1430 this->splitContainer1->Location = System::Drawing::Point(0, 115);
1431 this->splitContainer1->Name = L
"splitContainer1";
1435 this->splitContainer1->Panel1->Controls->Add(this->treeViewOtxProject);
1436 this->splitContainer1->Panel1->Controls->Add(this->label3);
1440 this->splitContainer1->Panel2->Controls->Add(this->splitContainer5);
1441 this->splitContainer1->Size = System::Drawing::Size(1328, 290);
1442 this->splitContainer1->SplitterDistance = 307;
1443 this->splitContainer1->TabIndex = 5;
1447 this->treeViewOtxProject->Dock = System::Windows::Forms::DockStyle::Fill;
1448 this->treeViewOtxProject->Enabled =
false;
1449 this->treeViewOtxProject->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
1450 this->treeViewOtxProject->HideSelection =
false;
1451 this->treeViewOtxProject->Location = System::Drawing::Point(0, 16);
1452 this->treeViewOtxProject->Name = L
"treeViewOtxProject";
1453 this->treeViewOtxProject->Size = System::Drawing::Size(307, 274);
1454 this->treeViewOtxProject->TabIndex = 1;
1455 this->treeViewOtxProject->DrawNode +=
gcnew System::Windows::Forms::DrawTreeNodeEventHandler(
this, &SampleForm::treeViewOtxProject_DrawNode);
1456 this->treeViewOtxProject->AfterSelect +=
gcnew System::Windows::Forms::TreeViewEventHandler(
this, &SampleForm::treeViewOtxProject_AfterSelect);
1460 this->label3->AutoSize =
true;
1461 this->label3->Dock = System::Windows::Forms::DockStyle::Top;
1462 this->label3->Location = System::Drawing::Point(0, 0);
1463 this->label3->Name = L
"label3";
1464 this->label3->Padding = System::Windows::Forms::Padding(0, 0, 0, 3);
1465 this->label3->Size = System::Drawing::Size(245, 16);
1466 this->label3->TabIndex = 0;
1467 this->label3->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/671A83F2.htm";
1468 this->label3->Text = L
"OTX-Project Tree (To execute select a Procedure)";
1472 this->splitContainer5->Dock = System::Windows::Forms::DockStyle::Fill;
1473 this->splitContainer5->FixedPanel = System::Windows::Forms::FixedPanel::Panel1;
1474 this->splitContainer5->Location = System::Drawing::Point(0, 0);
1475 this->splitContainer5->MinimumSize = System::Drawing::Size(0, 318);
1476 this->splitContainer5->Name = L
"splitContainer5";
1480 this->splitContainer5->Panel1->Controls->Add(this->splitContainer2);
1484 this->splitContainer5->Panel2->Controls->Add(this->panel3);
1485 this->splitContainer5->Panel2->Controls->Add(this->groupBox1);
1486 this->splitContainer5->Size = System::Drawing::Size(1017, 318);
1487 this->splitContainer5->SplitterDistance = 311;
1488 this->splitContainer5->TabIndex = 4;
1492 this->splitContainer2->Dock = System::Windows::Forms::DockStyle::Fill;
1493 this->splitContainer2->Location = System::Drawing::Point(0, 0);
1494 this->splitContainer2->Name = L
"splitContainer2";
1495 this->splitContainer2->Orientation = System::Windows::Forms::Orientation::Horizontal;
1499 this->splitContainer2->Panel1->Controls->Add(this->gridViewParameter);
1500 this->splitContainer2->Panel1->Controls->Add(this->labelAdjustProcedureParameters);
1504 this->splitContainer2->Panel2->Controls->Add(this->splitContainer3);
1505 this->splitContainer2->Size = System::Drawing::Size(311, 318);
1506 this->splitContainer2->SplitterDistance = 95;
1507 this->splitContainer2->TabIndex = 3;
1511 this->gridViewParameter->AllowUserToAddRows =
false;
1512 this->gridViewParameter->AllowUserToDeleteRows =
false;
1513 this->gridViewParameter->AllowUserToResizeRows =
false;
1514 this->gridViewParameter->BackgroundColor = System::Drawing::SystemColors::Window;
1515 this->gridViewParameter->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
1516 this->gridViewParameter->CellBorderStyle = System::Windows::Forms::DataGridViewCellBorderStyle::None;
1517 this->gridViewParameter->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
1518 this->gridViewParameter->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
1519 this->gridViewParameter->Columns->AddRange(
gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(5)
1521 this->dataGridViewTextBoxColumnName,
1522 this->dataGridViewTextBoxColumnDirection, this->dataGridViewTextBoxColumnDataType, this->dataGridViewTextBoxColumnValue, this->dataGridViewTextBoxColumnDetails
1524 dataGridViewCellStyle1->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
1525 dataGridViewCellStyle1->BackColor = System::Drawing::SystemColors::Window;
1526 dataGridViewCellStyle1->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
1527 static_cast<System::Byte
>(0)));
1528 dataGridViewCellStyle1->ForeColor = System::Drawing::SystemColors::ControlText;
1529 dataGridViewCellStyle1->SelectionBackColor = System::Drawing::SystemColors::Highlight;
1530 dataGridViewCellStyle1->SelectionForeColor = System::Drawing::SystemColors::HighlightText;
1531 dataGridViewCellStyle1->WrapMode = System::Windows::Forms::DataGridViewTriState::False;
1532 this->gridViewParameter->DefaultCellStyle = dataGridViewCellStyle1;
1533 this->gridViewParameter->Dock = System::Windows::Forms::DockStyle::Fill;
1534 this->gridViewParameter->Enabled =
false;
1535 this->gridViewParameter->EnableHeadersVisualStyles =
false;
1536 this->gridViewParameter->Location = System::Drawing::Point(0, 16);
1537 this->gridViewParameter->MultiSelect =
false;
1538 this->gridViewParameter->Name = L
"gridViewParameter";
1539 this->gridViewParameter->RowHeadersVisible =
false;
1540 this->gridViewParameter->RowHeadersWidth = 51;
1541 this->gridViewParameter->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
1542 this->gridViewParameter->Size = System::Drawing::Size(311, 79);
1543 this->gridViewParameter->StandardTab =
true;
1544 this->gridViewParameter->TabIndex = 1;
1545 this->gridViewParameter->CellContentClick +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridView_CellContentClick);
1546 this->gridViewParameter->CellValidated +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridViewParameter_CellValidated);
1547 this->gridViewParameter->CellValidating +=
gcnew System::Windows::Forms::DataGridViewCellValidatingEventHandler(
this, &SampleForm::gridViewParameter_CellValidating);
1548 this->gridViewParameter->CellValueChanged +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridView_CellValueChanged);
1552 this->dataGridViewTextBoxColumnName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1553 this->dataGridViewTextBoxColumnName->HeaderText = L
"Name";
1554 this->dataGridViewTextBoxColumnName->MinimumWidth = 6;
1555 this->dataGridViewTextBoxColumnName->Name = L
"dataGridViewTextBoxColumnName";
1556 this->dataGridViewTextBoxColumnName->ReadOnly =
true;
1557 this->dataGridViewTextBoxColumnName->Width = 58;
1561 this->dataGridViewTextBoxColumnDirection->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1562 this->dataGridViewTextBoxColumnDirection->HeaderText = L
"Direction";
1563 this->dataGridViewTextBoxColumnDirection->Name = L
"dataGridViewTextBoxColumnDirection";
1564 this->dataGridViewTextBoxColumnDirection->ReadOnly =
true;
1565 this->dataGridViewTextBoxColumnDirection->Width = 72;
1566 this->dataGridViewTextBoxColumnDirection->ReadOnly =
true;
1570 this->dataGridViewTextBoxColumnDataType->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1571 this->dataGridViewTextBoxColumnDataType->HeaderText = L
"DataType";
1572 this->dataGridViewTextBoxColumnDataType->MinimumWidth = 6;
1573 this->dataGridViewTextBoxColumnDataType->Name = L
"dataGridViewTextBoxColumnDataType";
1574 this->dataGridViewTextBoxColumnDataType->ReadOnly =
true;
1575 this->dataGridViewTextBoxColumnDataType->Width = 77;
1579 this->dataGridViewTextBoxColumnValue->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1580 this->dataGridViewTextBoxColumnValue->HeaderText = L
"Value";
1581 this->dataGridViewTextBoxColumnValue->MinimumWidth = 80;
1582 this->dataGridViewTextBoxColumnValue->Name = L
"dataGridViewTextBoxColumnValue";
1583 this->dataGridViewTextBoxColumnValue->Width = 80;
1587 this->dataGridViewTextBoxColumnDetails->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1588 this->dataGridViewTextBoxColumnDetails->HeaderText = L
"Details";
1589 this->dataGridViewTextBoxColumnDetails->Name = L
"dataGridViewTextBoxColumnDetails";
1590 this->dataGridViewTextBoxColumnDetails->ReadOnly =
true;
1591 this->dataGridViewTextBoxColumnDetails->Width = 62;
1595 this->labelAdjustProcedureParameters->AutoSize =
true;
1596 this->labelAdjustProcedureParameters->Dock = System::Windows::Forms::DockStyle::Top;
1597 this->labelAdjustProcedureParameters->Location = System::Drawing::Point(0, 0);
1598 this->labelAdjustProcedureParameters->Name = L
"labelAdjustProcedureParameters";
1599 this->labelAdjustProcedureParameters->Padding = System::Windows::Forms::Padding(0, 0, 0, 3);
1600 this->labelAdjustProcedureParameters->Size = System::Drawing::Size(188, 16);
1601 this->labelAdjustProcedureParameters->TabIndex = 0;
1602 this->labelAdjustProcedureParameters->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/94D3A64.htm";
1603 this->labelAdjustProcedureParameters->Text = L
"Parameters of the selected Procedure:";
1607 this->splitContainer3->Dock = System::Windows::Forms::DockStyle::Fill;
1608 this->splitContainer3->Location = System::Drawing::Point(0, 0);
1609 this->splitContainer3->Name = L
"splitContainer3";
1610 this->splitContainer3->Orientation = System::Windows::Forms::Orientation::Horizontal;
1614 this->splitContainer3->Panel1->Controls->Add(this->gridViewContext);
1615 this->splitContainer3->Panel1->Controls->Add(this->label4);
1619 this->splitContainer3->Panel2->Controls->Add(this->gridViewState);
1620 this->splitContainer3->Panel2->Controls->Add(this->label5);
1621 this->splitContainer3->Size = System::Drawing::Size(311, 219);
1622 this->splitContainer3->SplitterDistance = 105;
1623 this->splitContainer3->TabIndex = 0;
1627 this->gridViewContext->AllowUserToAddRows =
false;
1628 this->gridViewContext->AllowUserToDeleteRows =
false;
1629 this->gridViewContext->AllowUserToResizeRows =
false;
1630 this->gridViewContext->BackgroundColor = System::Drawing::SystemColors::Window;
1631 this->gridViewContext->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
1632 this->gridViewContext->CellBorderStyle = System::Windows::Forms::DataGridViewCellBorderStyle::None;
1633 this->gridViewContext->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
1634 this->gridViewContext->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
1635 this->gridViewContext->Columns->AddRange(
gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(4)
1637 this->dataGridViewTextBoxColumnContextName,
1638 this->dataGridViewTextBoxColumnContextDataType, this->dataGridViewTextBoxColumnContextValue, this->dataGridViewTextBoxColumnContextDetails
1640 dataGridViewCellStyle2->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
1641 dataGridViewCellStyle2->BackColor = System::Drawing::SystemColors::Window;
1642 dataGridViewCellStyle2->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
1643 dataGridViewCellStyle2->ForeColor = System::Drawing::SystemColors::ControlText;
1644 dataGridViewCellStyle2->SelectionBackColor = System::Drawing::SystemColors::Highlight;
1645 dataGridViewCellStyle2->SelectionForeColor = System::Drawing::SystemColors::HighlightText;
1646 dataGridViewCellStyle2->WrapMode = System::Windows::Forms::DataGridViewTriState::False;
1647 this->gridViewContext->DefaultCellStyle = dataGridViewCellStyle2;
1648 this->gridViewContext->Dock = System::Windows::Forms::DockStyle::Fill;
1649 this->gridViewContext->EnableHeadersVisualStyles =
false;
1650 this->gridViewContext->Location = System::Drawing::Point(0, 16);
1651 this->gridViewContext->MultiSelect =
false;
1652 this->gridViewContext->Name = L
"gridViewContext";
1653 this->gridViewContext->RowHeadersVisible =
false;
1654 this->gridViewContext->RowHeadersWidth = 51;
1655 this->gridViewContext->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
1656 this->gridViewContext->Size = System::Drawing::Size(311, 89);
1657 this->gridViewContext->StandardTab =
true;
1658 this->gridViewContext->TabIndex = 1;
1659 this->gridViewContext->CellContentClick +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridView_CellContentClick);
1660 this->gridViewContext->CellValidated +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridViewContextVariable_CellValidated);
1661 this->gridViewContext->CellValidating +=
gcnew System::Windows::Forms::DataGridViewCellValidatingEventHandler(
this, &SampleForm::gridViewContextVariable_CellValidating);
1662 this->gridViewContext->CellValueChanged +=
gcnew System::Windows::Forms::DataGridViewCellEventHandler(
this, &SampleForm::gridView_CellValueChanged);
1666 this->dataGridViewTextBoxColumnContextName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1667 this->dataGridViewTextBoxColumnContextName->HeaderText = L
"Name";
1668 this->dataGridViewTextBoxColumnContextName->MinimumWidth = 6;
1669 this->dataGridViewTextBoxColumnContextName->Name = L
"dataGridViewTextBoxColumnContextName";
1670 this->dataGridViewTextBoxColumnContextName->ReadOnly =
true;
1671 this->dataGridViewTextBoxColumnContextName->Width = 58;
1675 this->dataGridViewTextBoxColumnContextDataType->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1676 this->dataGridViewTextBoxColumnContextDataType->HeaderText = L
"DataType";
1677 this->dataGridViewTextBoxColumnContextDataType->MinimumWidth = 6;
1678 this->dataGridViewTextBoxColumnContextDataType->Name = L
"dataGridViewTextBoxColumnContextDataType";
1679 this->dataGridViewTextBoxColumnContextDataType->ReadOnly =
true;
1680 this->dataGridViewTextBoxColumnContextDataType->Width = 77;
1684 this->dataGridViewTextBoxColumnContextValue->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1685 this->dataGridViewTextBoxColumnContextValue->HeaderText = L
"Value";
1686 this->dataGridViewTextBoxColumnContextValue->MinimumWidth = 80;
1687 this->dataGridViewTextBoxColumnContextValue->Name = L
"dataGridViewTextBoxColumnContextValue";
1688 this->dataGridViewTextBoxColumnContextValue->Width = 80;
1692 this->dataGridViewTextBoxColumnContextDetails->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1693 this->dataGridViewTextBoxColumnContextDetails->HeaderText = L
"Details";
1694 this->dataGridViewTextBoxColumnContextDetails->Name = L
"dataGridViewTextBoxColumnContextDetails";
1695 this->dataGridViewTextBoxColumnContextDetails->Width = 62;
1699 this->label4->AutoSize =
true;
1700 this->label4->Dock = System::Windows::Forms::DockStyle::Top;
1701 this->label4->Location = System::Drawing::Point(0, 0);
1702 this->label4->Name = L
"label4";
1703 this->label4->Padding = System::Windows::Forms::Padding(0, 0, 0, 3);
1704 this->label4->Size = System::Drawing::Size(277, 16);
1705 this->label4->TabIndex = 0;
1706 this->label4->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/A926ED83.htm";
1707 this->label4->Text = L
"Set value for ContextVariables of the selected Document:";
1711 this->gridViewState->AllowUserToAddRows =
false;
1712 this->gridViewState->AllowUserToDeleteRows =
false;
1713 this->gridViewState->AllowUserToResizeRows =
false;
1714 this->gridViewState->BackgroundColor = System::Drawing::SystemColors::Window;
1715 this->gridViewState->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
1716 this->gridViewState->CellBorderStyle = System::Windows::Forms::DataGridViewCellBorderStyle::None;
1717 this->gridViewState->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
1718 this->gridViewState->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
1719 this->gridViewState->Columns->AddRange(
gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(4)
1721 this->dataGridViewTextBoxColumnStateName,
1722 this->dataGridViewTextBoxColumnStateDataType, this->dataGridViewTextBoxColumnStateValue, this->dataGridViewTextBoxColumnStateDetails
1724 dataGridViewCellStyle3->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
1725 dataGridViewCellStyle3->BackColor = System::Drawing::SystemColors::Window;
1726 dataGridViewCellStyle3->Font = (
gcnew System::Drawing::Font(L
"Consolas", 9));
1727 dataGridViewCellStyle3->ForeColor = System::Drawing::SystemColors::ControlText;
1728 dataGridViewCellStyle3->SelectionBackColor = System::Drawing::SystemColors::Highlight;
1729 dataGridViewCellStyle3->SelectionForeColor = System::Drawing::SystemColors::HighlightText;
1730 dataGridViewCellStyle3->WrapMode = System::Windows::Forms::DataGridViewTriState::False;
1731 this->gridViewState->DefaultCellStyle = dataGridViewCellStyle3;
1732 this->gridViewState->Dock = System::Windows::Forms::DockStyle::Fill;
1733 this->gridViewState->EnableHeadersVisualStyles =
false;
1734 this->gridViewState->Location = System::Drawing::Point(0, 16);
1735 this->gridViewState->MultiSelect =
false;
1736 this->gridViewState->Name = L
"gridViewState";
1737 this->gridViewState->RowHeadersVisible =
false;
1738 this->gridViewState->RowHeadersWidth = 51;
1739 this->gridViewState->Size = System::Drawing::Size(311, 94);
1740 this->gridViewState->StandardTab =
true;
1741 this->gridViewState->TabIndex = 1;
1745 this->dataGridViewTextBoxColumnStateName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::DisplayedCells;
1746 this->dataGridViewTextBoxColumnStateName->HeaderText = L
"Name";
1747 this->dataGridViewTextBoxColumnStateName->MinimumWidth = 6;
1748 this->dataGridViewTextBoxColumnStateName->Name = L
"dataGridViewTextBoxColumnStateName";
1749 this->dataGridViewTextBoxColumnStateName->ReadOnly =
true;
1750 this->dataGridViewTextBoxColumnStateName->Width = 58;
1754 this->dataGridViewTextBoxColumnStateDataType->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1755 this->dataGridViewTextBoxColumnStateDataType->HeaderText = L
"DataType";
1756 this->dataGridViewTextBoxColumnStateDataType->MinimumWidth = 6;
1757 this->dataGridViewTextBoxColumnStateDataType->Name = L
"dataGridViewTextBoxColumnStateDataType";
1758 this->dataGridViewTextBoxColumnStateDataType->ReadOnly =
true;
1759 this->dataGridViewTextBoxColumnStateDataType->Width = 77;
1763 this->dataGridViewTextBoxColumnStateValue->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1764 this->dataGridViewTextBoxColumnStateValue->HeaderText = L
"Value";
1765 this->dataGridViewTextBoxColumnStateValue->MinimumWidth = 80;
1766 this->dataGridViewTextBoxColumnStateValue->Name = L
"dataGridViewTextBoxColumnStateValue";
1767 this->dataGridViewTextBoxColumnStateValue->ReadOnly =
true;
1768 this->dataGridViewTextBoxColumnStateValue->Width = 80;
1772 this->dataGridViewTextBoxColumnStateDetails->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
1773 this->dataGridViewTextBoxColumnStateDetails->HeaderText = L
"Details";
1774 this->dataGridViewTextBoxColumnStateDetails->Name = L
"dataGridViewTextBoxColumnStateDetails";
1775 this->dataGridViewTextBoxColumnStateDetails->ReadOnly =
true;
1776 this->dataGridViewTextBoxColumnStateDetails->Width = 62;
1780 this->label5->AutoSize =
true;
1781 this->label5->Dock = System::Windows::Forms::DockStyle::Top;
1782 this->label5->Location = System::Drawing::Point(0, 0);
1783 this->label5->Name = L
"label5";
1784 this->label5->Padding = System::Windows::Forms::Padding(0, 0, 0, 3);
1785 this->label5->Size = System::Drawing::Size(248, 16);
1786 this->label5->TabIndex = 0;
1787 this->label5->Tag = L
"http://www.emotive.de/DeveloperReference/OtxRuntime/html/94D3A64.htm";
1788 this->label5->Text = L
"Display Status Variables of the selected Document:";
1792 this->panel3->Controls->Add(this->gridViewSettings);
1793 this->panel3->Controls->Add(this->panel4);
1794 this->panel3->Dock = System::Windows::Forms::DockStyle::Fill;
1795 this->panel3->Location = System::Drawing::Point(0, 46);
1796 this->panel3->Name = L
"panel3";
1797 this->panel3->Size = System::Drawing::Size(702, 272);
1798 this->panel3->TabIndex = 1;
1802 this->gridViewSettings->AllowUserToAddRows =
false;
1803 this->gridViewSettings->AllowUserToDeleteRows =
false;
1804 this->gridViewSettings->AllowUserToResizeRows =
false;
1805 this->gridViewSettings->BackgroundColor = System::Drawing::SystemColors::Window;
1806 this->gridViewSettings->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
1807 this->gridViewSettings->CellBorderStyle = System::Windows::Forms::DataGridViewCellBorderStyle::None;
1808 this->gridViewSettings->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
1809 this->gridViewSettings->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
1810 this->gridViewSettings->Columns->AddRange(
gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(2)
1812 this->dataGridViewTextBoxColumnSettingName,
1813 this->dataGridViewTextBoxColumnSettingValue
1815 this->gridViewSettings->Dock = System::Windows::Forms::DockStyle::Fill;
1816 this->gridViewSettings->Location = System::Drawing::Point(0, 28);
1817 this->gridViewSettings->MultiSelect =
false;
1818 this->gridViewSettings->Name = L
"gridViewSettings";
1819 this->gridViewSettings->RowHeadersVisible =
false;
1820 this->gridViewSettings->RowHeadersWidth = 51;
1821 this->gridViewSettings->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
1822 this->gridViewSettings->Size = System::Drawing::Size(702, 244);
1823 this->gridViewSettings->StandardTab =
true;
1824 this->gridViewSettings->TabIndex = 1;
1828 this->dataGridViewTextBoxColumnSettingName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::Fill;
1829 this->dataGridViewTextBoxColumnSettingName->HeaderText = L
"Name";
1830 this->dataGridViewTextBoxColumnSettingName->MinimumWidth = 100;
1831 this->dataGridViewTextBoxColumnSettingName->Name = L
"dataGridViewTextBoxColumnSettingName";
1832 this->dataGridViewTextBoxColumnSettingName->ReadOnly =
true;
1836 this->dataGridViewTextBoxColumnSettingValue->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::Fill;
1837 this->dataGridViewTextBoxColumnSettingValue->HeaderText = L
"Value";
1838 this->dataGridViewTextBoxColumnSettingValue->MinimumWidth = 160;
1839 this->dataGridViewTextBoxColumnSettingValue->Name = L
"dataGridViewTextBoxColumnSettingValue";
1843 this->panel4->Controls->Add(this->label12);
1844 this->panel4->Controls->Add(this->buttonWriteSettings);
1845 this->panel4->Controls->Add(this->buttonReadSettings);
1846 this->panel4->Dock = System::Windows::Forms::DockStyle::Top;
1847 this->panel4->Location = System::Drawing::Point(0, 0);
1848 this->panel4->Name = L
"panel4";
1849 this->panel4->Padding = System::Windows::Forms::Padding(20, 0, 20, 0);
1850 this->panel4->Size = System::Drawing::Size(702, 28);
1851 this->panel4->TabIndex = 0;
1855 this->label12->AutoSize =
true;
1856 this->label12->Location = System::Drawing::Point(2, 8);
1857 this->label12->Name = L
"label12";
1858 this->label12->Padding = System::Windows::Forms::Padding(0, 3, 0, 3);
1859 this->label12->Size = System::Drawing::Size(81, 19);
1860 this->label12->TabIndex = 0;
1861 this->label12->Text = L
"Project Settings";