Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date related type initialization in POCO objects now initialized to the min value of the controllers. #363

Conversation

PTKu
Copy link
Contributor

@PTKu PTKu commented Jan 22, 2025

Refactors initializers for date related types in poco object

  • Added NullabeDateRelatedPrimitives dictionary to IecToClrConverter for handling date-related types.
  • Introduced CreateScalarInitializer method for scalar type initializations.
  • Added IsNullableDateRelatedPrimitive method.
  • Moved and privatized IsNullablePrimitive method in IecToClrConverter.
  • Updated CsPlainSourceBuilder to use CreateScalarInitializer.
  • Changed default initializers for DateOnly and DateTime in Pocos namespace files to new DateOnly(1970, 1, 1) and new DateTime(1970, 1, 1).
  • Updated apax-lock.json with deprecation warnings for certain package versions.
  • Modified all_primitives.g.cs and realmonster.g.cs to use new default initializers for DateOnly and DateTime.

This pull request includes several changes to the AXSharp.compiler and AXSharp.connectors projects, focusing on improving the handling of nullable date-related primitives and updating package dependencies with deprecation notices.

Improvements to Nullable Date-Related Primitives Handling:

Updates to Test Files:

Deprecation Notices in Package Dependencies:

These changes improve the handling of nullable date-related primitives and ensure that users are aware of deprecated package versions, guiding them to update to supported versions.

closes #330

- Added `NullabeDateRelatedPrimitives` dictionary to `IecToClrConverter` for handling date-related types.
- Introduced `CreateScalarInitializer` method for scalar type initializations.
- Added `IsNullableDateRelatedPrimitive` method.
- Moved and privatized `IsNullablePrimitive` method in `IecToClrConverter`.
- Updated `CsPlainSourceBuilder` to use `CreateScalarInitializer`.
- Changed default initializers for `DateOnly` and `DateTime` in `Pocos` namespace files to `new DateOnly(1970, 1, 1)` and `new DateTime(1970, 1, 1)`.
- Updated `apax-lock.json` with deprecation warnings for certain package versions.
- Modified `all_primitives.g.cs` and `realmonster.g.cs` to use new default initializers for `DateOnly` and `DateTime`.
@PTKu PTKu requested a review from kuh0005 January 22, 2025 11:49
@PTKu PTKu added the enhancement New feature or request label Jan 22, 2025
@PTKu PTKu added this to the v0.22.0 milestone Jan 22, 2025
…rget ax and tia

Refactor and enhance compiler options and tests

Updated `Directory.Packages.props` to reformat `PackageVersion` elements and upgrade `nunit` package version. Added `TargetPlatformMoniker` property to `ICompilerOptions` interface and implemented it in `AXSharpConfig` and `Options` classes. Modified `IecToClrConverter` to handle `targetPlatformMoniker` parameter and added methods for default values based on target platform. Updated `CsPlainSourceBuilder` and `CsSourceBuilderTests` to pass `TargetPlatformMoniker`.

Restructured `AXSharp.Compiler.CsTests.csproj` to simplify file inclusion and added new package references. Added `CompilerTestOptions` class and updated `CsSourceBuilderTests` to use it. Introduced `CsOnlinerSourceBuilder` class for specific platform configurations.

Refactored `IxProjectTests` to be abstract and added platform-specific subclasses. Added new classes for handling various data types and configurations, including `unitsTwinController`, `AbstractMotor`, `array_declaration_class`, `class_all_primitives`, `State1Transition`, `Extended`, `ExtendsAndImplements`, `Extender`, `Extendee`, `SomeType`, `_NULL_CONTEXT`, `_NULL_CONTEXT_MULTIPLE`, `ClassWithComplexTypes`, `NoAccessModifierClass`, `ClassWithNonTraspilableMembers`, `ClassWithPragmas`, `ClassWithPrimitiveTypes`, and `ClassWithUsingDirectives`.

Enhanced localization support and added methods for managing children, kids, and value tags. Marked obsolete methods with appropriate attributes. Updated project files to target multiple frameworks and added new tests to verify functionality.
@PTKu PTKu merged commit e93cb05 into dev Jan 23, 2025
2 checks passed
@PTKu PTKu deleted the 330-new-feature-poco-property-of-datetime-has-different-default-value-than-plc branch January 23, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NEW-FEATURE] Poco property of DateTime has different default value than PLC
1 participant