diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5ac77422c..c375927e0 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "AXSharp.ixc": { - "version": "0.14.0-alpha.86", + "version": "0.14.0-alpha.87", "commands": [ "ixc" ] @@ -15,10 +15,16 @@ ] }, "AXSharp.ixd": { - "version": "0.14.0-alpha.86", + "version": "0.14.0-alpha.87", "commands": [ "ixd" ] + }, + "AXSharp.ixr": { + "version": "0.14.0-alpha.87", + "commands": [ + "ixr" + ] } } } \ No newline at end of file diff --git a/cake/BuildContext.cs b/cake/BuildContext.cs index 0667c48f8..935e38742 100644 --- a/cake/BuildContext.cs +++ b/cake/BuildContext.cs @@ -137,11 +137,11 @@ public BuildContext(ICakeContext context, BuildParameters buildParameters) public IEnumerable<(string folder, string name)> Libraries { get; } = new[] { - ("abstractions", "ix.framework.abstractions"), - ("utils", "ix.framework.utils"), - ("core", "ix.framework.core"), - ("messaging", "ix.framework.messaging"), - ("data", "ix.framework.data"), + ("abstractions", "axopen.abstractions"), + ("utils", "axopen.utils"), + ("core", "axopen.core"), + ("messaging", "axopen.messaging"), + ("data", "axopen.data"), ("probers", "ix.framework.probers"), }; diff --git a/src/abstractions/ctrl/AXSharp.config.json b/src/abstractions/ctrl/AXSharp.config.json index f98ad5c33..49babc4d3 100644 --- a/src/abstractions/ctrl/AXSharp.config.json +++ b/src/abstractions/ctrl/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"..\\src\\ix.framework.abstractions"} \ No newline at end of file +{"OutputProjectFolder":"..\\src\\AXOpen.Abstractions"} \ No newline at end of file diff --git a/src/abstractions/ctrl/apax.yml b/src/abstractions/ctrl/apax.yml index 35271aab6..8eb3a5865 100644 --- a/src/abstractions/ctrl/apax.yml +++ b/src/abstractions/ctrl/apax.yml @@ -1,5 +1,5 @@ -name: "@ix-ax/ix.framework.abstractions" -version : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' +name: "@ix-ax/axopen.abstractions" +version : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' type: lib targets: - "1500" diff --git a/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.153.apax.tgz b/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.153.apax.tgz new file mode 100644 index 000000000..2662906a4 Binary files /dev/null and b/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.153.apax.tgz differ diff --git a/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.161.apax.tgz b/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.161.apax.tgz new file mode 100644 index 000000000..13f15be16 Binary files /dev/null and b/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.161.apax.tgz differ diff --git a/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169.apax.tgz b/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169.apax.tgz new file mode 100644 index 000000000..2e84be785 Binary files /dev/null and b/src/abstractions/ctrl/ix-ax-axopen.abstractions-0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169.apax.tgz differ diff --git a/src/abstractions/ctrl/src/Messaging/AxoConstants.st b/src/abstractions/ctrl/src/Messaging/AxoConstants.st new file mode 100644 index 000000000..510a6fb57 --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/AxoConstants.st @@ -0,0 +1,9 @@ +NAMESPACE AXOpen.Messaging + TYPE PUBLIC + AxoIntConstants : INT + ( + MAX_MESSAGE_TEXT_LENGHT := 160, + MDS_MAX_INDEX := 10 + ); + END_TYPE +END_NAMESPACE diff --git a/src/abstractions/ctrl/src/Messaging/AxoMessageDigest.st b/src/abstractions/ctrl/src/Messaging/AxoMessageDigest.st new file mode 100644 index 000000000..f51d65741 --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/AxoMessageDigest.st @@ -0,0 +1,10 @@ +NAMESPACE AXOpen.Messaging + CLASS PUBLIC AxoMessageDigest + VAR PUBLIC + Digest : DWORD; + Cycle : ULINT; + Count : ULINT; + Category : eAxoMessageCategory; + END_VAR + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/abstractions/ctrl/src/Messaging/AxoMessengerEnv.st b/src/abstractions/ctrl/src/Messaging/AxoMessengerEnv.st new file mode 100644 index 000000000..5f10153b6 --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/AxoMessengerEnv.st @@ -0,0 +1,59 @@ +USING AXOpen.Utils; + +NAMESPACE AXOpen.Messaging + CLASS PUBLIC AxoMessengerEnv IMPLEMENTS IAxoMessengerEnv + VAR + _minLevel : eAxoMessageCategory; + _isMessagingSuspended : BOOL; + _messageDigestMethod : eAxoMessageDigestMethod := eAxoMessageDigestMethod#CRC16; + //_messengerLoggingMethod : eIxMessengerLogMethod := eIxMessengerLogMethod#OnEventRisen; + _sb : REF_TO AxoStringBuilder; + END_VAR + + /// + METHOD PUBLIC IsSuspended: BOOL + IsSuspended := _isMessagingSuspended; + END_METHOD + + /// + METHOD PUBLIC GetMessageDigestMethod : eAxoMessageDigestMethod + GetMessageDigestMethod := _messageDigestMethod; + END_METHOD + + /// + METHOD PUBLIC SetMessageDigestMethod + VAR_INPUT + inDigestMethod : eAxoMessageDigestMethod; + END_VAR + _messageDigestMethod := inDigestMethod; + END_METHOD + + /// + METHOD PUBLIC GetMinLevel : eAxoMessageCategory + GetMinLevel := _minLevel; + END_METHOD + + /// + METHOD PUBLIC SetMinLevel + VAR_INPUT + inMessageCategory : eAxoMessageCategory; + END_VAR + _minLevel := inMessageCategory; + END_METHOD + + /// + METHOD PUBLIC Resume + _isMessagingSuspended := FALSE; + END_METHOD + + /// + METHOD PUBLIC Suspend + _isMessagingSuspended := TRUE; + END_METHOD + + /// + METHOD PUBLIC GetStringBuilder : REF_TO AxoStringBuilder + GetStringBuilder ?= _sb; + END_METHOD + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/abstractions/ctrl/src/Messaging/IAxoMessageCategorize.st b/src/abstractions/ctrl/src/Messaging/IAxoMessageCategorize.st new file mode 100644 index 000000000..1e067fba2 --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/IAxoMessageCategorize.st @@ -0,0 +1,33 @@ +NAMESPACE AXOpen.Messaging + INTERFACE IAxoMessageCategorize + /// + /// Categorizes and creates the message as 'debug'. + /// + METHOD AsDebug : IAxoMessageProperties END_METHOD + + /// + /// Categorizes and creates the message as 'error'. + /// + METHOD AsError : IAxoMessageProperties END_METHOD + + /// + /// Categorizes and creates the message as 'fatal'. + /// + METHOD AsFatal : IAxoMessageProperties END_METHOD + + /// + /// Categorizes and creates the message as 'info'. + /// + METHOD AsInfo : IAxoMessageProperties END_METHOD + + /// + /// Categorizes and creates the message as 'trace'. + /// + METHOD AsTrace : IAxoMessageProperties END_METHOD + + /// + /// Categorizes and creates the message as 'warning'. + /// + METHOD AsWarning : IAxoMessageProperties END_METHOD + END_INTERFACE +END_NAMESPACE diff --git a/src/abstractions/ctrl/src/Messaging/IAxoMessageProperties.st b/src/abstractions/ctrl/src/Messaging/IAxoMessageProperties.st new file mode 100644 index 000000000..cbd2d2161 --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/IAxoMessageProperties.st @@ -0,0 +1,6 @@ +NAMESPACE AXOpen.Messaging + INTERFACE IAxoMessageProperties + METHOD Pin: IAxoMessageProperties END_METHOD + METHOD IsPinned: BOOL END_METHOD + END_INTERFACE +END_NAMESPACE diff --git a/src/abstractions/ctrl/src/Messaging/IAxoMessageTextBuilder.st b/src/abstractions/ctrl/src/Messaging/IAxoMessageTextBuilder.st new file mode 100644 index 000000000..c9a2e15de --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/IAxoMessageTextBuilder.st @@ -0,0 +1,48 @@ +NAMESPACE AXOpen.Messaging + INTERFACE IAxoMessageTextBuilder + /// + /// Appends string to the message text. + /// + /// + /// + /// The size of the resulting string should not be more than '160' characters. The characters exceeding this size will be truncated. + /// + /// + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : BOOL; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : BYTE; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : WORD; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : DWORD; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : LWORD; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : SINT; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : INT; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : DINT; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : LINT; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : USINT; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : UINT; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : UDINT; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : ULINT; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : REAL; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : LREAL; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : TIME; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : LTIME; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : DATE; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : LDATE; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : TIME_OF_DAY; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : LTIME_OF_DAY; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : DATE_AND_TIME; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : LDATE_AND_TIME; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : CHAR; END_VAR END_METHOD + // METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : WCHAR; END_VAR END_METHOD + METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; END_VAR END_METHOD + // METHOD Append : IAxoMessageTextBuilder VAR_INPUT Data : WSTRING[IxIntConstants#MAX_MESSAGE_TEXT_LENGHT]; END_VAR END_METHOD + /// + /// Gets categorization methods for fluent message builder. + /// + METHOD As : IAxoMessageCategorize END_METHOD + + /// + /// Initiates new message text building for this messenger in fluent-like fashion. + /// + METHOD Build : IAxoMessageTextBuilder END_METHOD + END_INTERFACE +END_NAMESPACE diff --git a/src/abstractions/ctrl/src/Messaging/IAxoMessages.st b/src/abstractions/ctrl/src/Messaging/IAxoMessages.st new file mode 100644 index 000000000..d3ea28a7c --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/IAxoMessages.st @@ -0,0 +1,122 @@ +NAMESPACE AXOpen.Messaging + INTERFACE IAxoMessages + /// + /// Adds message of 'debug' category to the message queue. + /// + METHOD Debug : IAxoMessageProperties + VAR_INPUT + /// + /// Arbitrary message string. + /// + Message : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; + END_VAR + END_METHOD + + /// + /// Adds message of 'error' category to the message queue. + /// + METHOD Error : IAxoMessageProperties + VAR_INPUT + /// + /// Arbitrary message string. + /// + Message : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; + END_VAR + END_METHOD + + /// + /// Adds message of 'information' category to the message queue. + /// + METHOD Info : IAxoMessageProperties + VAR_INPUT + /// + /// Arbitrary message string. + /// + Message : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; + END_VAR + END_METHOD + + /// + /// Adds message of 'notification' category to the message queue. + /// + METHOD Notify : IAxoMessageProperties + VAR_INPUT + /// + /// Arbitrary message string. + /// + Message : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; + END_VAR + END_METHOD + + + /// + /// Adds message of 'programming error' category to the message queue. + /// + METHOD Programming : IAxoMessageProperties + VAR_INPUT + /// + /// Arbitrary message string. + /// + Message : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; + END_VAR + END_METHOD + + + /// + /// Adds message of 'trace' category to the message queue. + /// + METHOD Trace : IAxoMessageProperties + VAR_INPUT + /// + /// Arbitrary message string. + /// + Message : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; + END_VAR + END_METHOD + + + /// + /// Adds message of 'warning' category to the message queue. + /// + METHOD Warning : IAxoMessageProperties + VAR_INPUT + /// + /// Arbitrary message string. + /// + Message : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; + END_VAR + END_METHOD + + METHOD Build: IAxoMessageTextBuilder END_METHOD + + /// + /// Adds message of given category to the message queue. + /// + /// Message index. + METHOD Post : IAxoMessageProperties + VAR_INPUT + /// + /// Arbitrary message string. + /// + Message : STRING[AxoIntConstants#MAX_MESSAGE_TEXT_LENGHT]; + /// + /// Message category. + /// + Category : eAxoMessageCategory; + END_VAR + END_METHOD + + /// + /// Unpins this messenger. + /// + METHOD UnPin END_METHOD + + END_INTERFACE +END_NAMESPACE + + + + + + + diff --git a/src/abstractions/ctrl/src/Messaging/IAxoMessenger.st b/src/abstractions/ctrl/src/Messaging/IAxoMessenger.st new file mode 100644 index 000000000..05ebf0317 --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/IAxoMessenger.st @@ -0,0 +1,20 @@ +NAMESPACE AXOpen.Messaging + INTERFACE IAxoMessenger + /// + /// Clears the message content. + /// + /// + /// This method is exposed for Rpc calls, for testing purposes. Rpc calls of this method must not be used in production code + /// + /// + /// + METHOD Clear END_METHOD + + + METHOD OnCondition : IAxoMessages + VAR_INPUT + inCondition : BOOL; + END_VAR + END_METHOD + END_INTERFACE +END_NAMESPACE diff --git a/src/abstractions/ctrl/src/Messaging/IAxoMessengerEnv.st b/src/abstractions/ctrl/src/Messaging/IAxoMessengerEnv.st new file mode 100644 index 000000000..cac24e29f --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/IAxoMessengerEnv.st @@ -0,0 +1,73 @@ +NAMESPACE AXOpen.Messaging + INTERFACE IAxoMessengerEnv + /// + /// Gets whether the messaging is suspended at this point in program. + /// + /// See also + /// + /// + /// See also + /// + /// + /// See also + /// + /// + METHOD IsSuspended: BOOL END_METHOD + /// + /// Gets the message digest method. + /// Message digest serves to fingerprint messages. + /// + METHOD GetMessageDigestMethod : eAxoMessageDigestMethod END_METHOD + /// + /// Sets the message digest method. + /// Message digest serves to fingerprint messages. + /// + METHOD SetMessageDigestMethod VAR_INPUT inDigestMethod : eAxoMessageDigestMethod; END_VAR END_METHOD + /// + /// Gets the minimal messaging level, the objects will post only messages for the levels of this or superior severity. + /// + /// See also + /// + /// + /// See also + /// + /// + /// See also + /// + /// + METHOD GetMinLevel : eAxoMessageCategory END_METHOD + /// + /// Sets the minimal messaging level, the objects will post only messages for the levels of this or superior severity. + /// + /// See also + /// + /// + /// See also + /// + /// + /// See also + /// + /// + METHOD SetMinLevel VAR_INPUT inMessageCategory : eAxoMessageCategory; END_VAR END_METHOD + /// + /// Resumes messaging from the all objects of this context, when the messaging was previously suspended by ```Suspend``` method. + /// + /// See also + /// + /// + /// See also + /// + /// + METHOD Resume END_METHOD + /// + /// Suspends messaging from the all objects of this context that would occur from this point in the call tree. + /// + /// See also + /// + /// + /// See also + /// + /// + METHOD Suspend END_METHOD + END_INTERFACE +END_NAMESPACE diff --git a/src/abstractions/ctrl/src/Messaging/eAxoMessageCategory.st b/src/abstractions/ctrl/src/Messaging/eAxoMessageCategory.st new file mode 100644 index 000000000..83a2e52e3 --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/eAxoMessageCategory.st @@ -0,0 +1,84 @@ +NAMESPACE AXOpen.Messaging + TYPE PUBLIC + /// + /// Message categories. + /// ATTENTION: Values must be multiply of 100 + /// + eAxoMessageCategory : INT + ( + All := 0, + + /// + /// Trace message to be used for tracing purpose. + /// Use when you need to track detailed information about internal states of the program for detailed visibility. + /// This is lowest level of category that can be used in production, for detailed observation of PLC program. + /// + Trace := 100, + + /// + /// Debug message to be used for debugging purpose only. + /// Use when you need to report debug information for you as programmer. + /// + Debug := 200, + + /// + /// Info message. + /// Use when you want to deliver information to the user, that has only informative character and does not adversely affect a process. + /// + Info := 300, + + /// + /// Time-out message. + /// Use this category when you want to report a timed-out information, that may eventually succed. + /// + TimedOut := 400, + + /// + /// Notification message. + /// Use this category when you want to report a notification that may be of interest to the user, but does not adversly affect a process. + /// + Notification := 500, + + /// + /// Warning message. + /// Use this category when you want to report to the user an information about a possible problem, that may adversly affect a process. + /// Information in this cateogory aims to help the user to identify a problem, the cause of such problem does not necessarily stops the process. + /// + Warning := 600, + + /// + /// Error message. + /// Use this categoty when there is a failure that cannot be immediately recovered and an intervention is needed. This is typically a situation when a device fails + /// to deliver expected result. + /// Do not use this category to report information about failed process like measurement or detection. + /// + Error := 700, + + /// + /// Programming issue. + /// Use this category to inform about a possible programming error, defect in settings or missing information at a level of programming or system or process settings. + /// + ProgrammingError := 900, + + /// + /// Critical error. + /// Use this category when a critical error occured, that is not recoverable by the means of software (reset/restore) but device still operates under such conditions; a detailed inspection and an expert action is required. + /// + Critical := 1000, + + /// + /// Fatal error. + /// Use this category when a fatal error occured, that is not recoverable by the means of software (reset/restore) and a detailed inspection is required, the device is not able to continue without special intervention, + /// + Fatal := 1100, + + /// + /// Catastrophic error. + /// Use this category when there is a situation when the device cannot continue operations due to irrecoverable failure. + /// + Catastrophic := 1200, + + None := 32000 + ); + END_TYPE +END_NAMESPACE \ No newline at end of file diff --git a/src/abstractions/ctrl/src/Messaging/eAxoMessageDigestMethod.st b/src/abstractions/ctrl/src/Messaging/eAxoMessageDigestMethod.st new file mode 100644 index 000000000..fc3f0d728 --- /dev/null +++ b/src/abstractions/ctrl/src/Messaging/eAxoMessageDigestMethod.st @@ -0,0 +1,33 @@ +NAMESPACE AXOpen.Messaging + /// + /// Message digest methods used to create fingerprint of a message. + /// + TYPE eAxoMessageDigestMethod : INT + ( + /// + /// Fastest method with highest probability of colisions. + /// + CRC8 := 8, + + /// + /// Moderate speed method with lower probability of colisions. + /// + CRC16 := 16, + + /// + /// Slowest speed method with relatively low probability of colisions. + /// + CRC32 := 32, + + /// + /// Messages are not digested the repeated messages won't be filtered out. + /// Use this option on low performance devices. + /// + NONE := 32767 + ); + END_TYPE +END_NAMESPACE + + + + diff --git a/src/abstractions/ctrl/src/Rtc/IAxoRtc.st b/src/abstractions/ctrl/src/Rtc/IAxoRtc.st new file mode 100644 index 000000000..1d169f732 --- /dev/null +++ b/src/abstractions/ctrl/src/Rtc/IAxoRtc.st @@ -0,0 +1,5 @@ +NAMESPACE AXOpen.Rtc + INTERFACE PUBLIC IAxoRtc + METHOD NowUTC : LDATE_AND_TIME END_METHOD + END_INTERFACE +END_NAMESPACE diff --git a/src/abstractions/ctrl/src/Utilities/AxoStringBuilder.st b/src/abstractions/ctrl/src/Utilities/AxoStringBuilder.st new file mode 100644 index 000000000..a955e8a63 --- /dev/null +++ b/src/abstractions/ctrl/src/Utilities/AxoStringBuilder.st @@ -0,0 +1,253 @@ +USING System.Strings; + +NAMESPACE AXOpen.Utils + /// + /// Allows to concat strings using fluent interface. It's similar to C# StringBuilder class + /// Usage as follows : + /// + /// ErrorString := _stringBuilder + /// .Clear() + /// .Append('Error number: ') + /// .Append(ErrorNumber) + /// .Append('. Message: ') + /// .Append(ErrorMessage) + /// .Append('.') + /// .AsString(); + /// + /// Inspired by Gerhard Barteling blogpost at https://www.plccoder.com/fluent-code/ + /// + CLASS PUBLIC AxoStringBuilder IMPLEMENTS IAxoStringBuilder + VAR + _workString: STRING[254]; + END_VAR + + METHOD PUBLIC Clear : IAxoStringBuilder + _workString := ''; + Clear := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : BOOL; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : BYTE; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : WORD; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : DWORD; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : LWORD; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : SINT; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : INT; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : DINT; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : LINT; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : USINT; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : UINT; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : UDINT; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : ULINT; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : REAL; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : LREAL; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : TIME; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : LTIME; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : DATE; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : LDATE; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : TIME_OF_DAY; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : LTIME_OF_DAY; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : DATE_AND_TIME; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : LDATE_AND_TIME; + END_VAR + _workString := Concat(_workString,ToString(Data)); + Append := THIS; + END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : CHAR; + END_VAR + _workString := Concat(_workString,Data); + Append := THIS; + END_METHOD + + // METHOD PUBLIC Append : IStringBuilder + // VAR_INPUT + // Data : WCHAR; + // END_VAR + // _workString := Concat(_workString,ToString(Data)); + // Append := THIS; + // END_METHOD + + METHOD PUBLIC Append : IAxoStringBuilder + VAR_INPUT + Data : STRING[254]; + END_VAR + _workString := Concat(_workString,Data); + Append := THIS; + END_METHOD + + // METHOD PUBLIC Append : IStringBuilder + // VAR_INPUT + // Data :WSTRING[254]; + // END_VAR + // _workString := Concat(_workString,ToString(Data)); + // Append := THIS; + // END_METHOD + + METHOD PUBLIC AsString : STRING[254] + AsString := _workString; + END_METHOD + + METHOD PUBLIC AsString160 : STRING[160] + AsString160 := _workString; + END_METHOD + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/abstractions/ctrl/src/Utilities/IAxoStringBuilder.st b/src/abstractions/ctrl/src/Utilities/IAxoStringBuilder.st new file mode 100644 index 000000000..f342caa81 --- /dev/null +++ b/src/abstractions/ctrl/src/Utilities/IAxoStringBuilder.st @@ -0,0 +1,47 @@ +NAMESPACE AXOpen.Utils + /// + /// Allows to concat strings using fluent interface. It's similar to C# StringBuilder class + /// Usage as follows : + /// + /// ErrorString := _stringBuilder + /// .Clear() + /// .Append('Error number: ') + /// .Append(ErrorNumber) + /// .Append('. Message: ') + /// .Append(ErrorMessage) + /// .Append('.') + /// .AsString(); + /// + /// Inspired by Gerhard Barteling blogpost at https://www.plccoder.com/fluent-code/ + /// + INTERFACE IAxoStringBuilder + METHOD Clear : IAxoStringBuilder END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : BOOL; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : BYTE; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : WORD; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : DWORD; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : LWORD; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : SINT; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : INT; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : DINT; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : LINT; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : USINT; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : UINT; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : UDINT; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : ULINT; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : REAL; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : LREAL; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : TIME; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : LTIME; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : DATE; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : LDATE; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : TIME_OF_DAY; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : LTIME_OF_DAY; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : DATE_AND_TIME; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : LDATE_AND_TIME; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : CHAR; END_VAR END_METHOD + // METHOD Append : IAxoStringBuilder VAR_INPUT Data : WCHAR; END_VAR END_METHOD + METHOD Append : IAxoStringBuilder VAR_INPUT Data : STRING[254]; END_VAR END_METHOD + // METHOD Append : IAxoStringBuilder VAR_INPUT Data : WSTRING[254]; END_VAR END_METHOD + END_INTERFACE +END_NAMESPACE \ No newline at end of file diff --git a/src/abstractions/ctrl/test/AXOpenUtils/AxoStringBuilder_UnitTests.st b/src/abstractions/ctrl/test/AXOpenUtils/AxoStringBuilder_UnitTests.st new file mode 100644 index 000000000..08d5eba30 --- /dev/null +++ b/src/abstractions/ctrl/test/AXOpenUtils/AxoStringBuilder_UnitTests.st @@ -0,0 +1,72 @@ +USING AxUnit; +USING AXOpen.Utils; +USING System.Strings; + +NAMESPACE AXOpen.Utils.Unit_Tests + + + {TestFixture} + CLASS AxoStringBuilder_UnitTests + VAR PROTECTED + _sb : AxoStringBuilder; + END_VAR + + {Test} + METHOD PUBLIC StringBuilderWillAppendText + VAR + wordsToAppend: ARRAY[0..8] OF STRING := ['Hello','how','are','you','doing','?','Fine','Thank','You']; + expected : STRING; + wordToAppend : STRING; + i : INT; + END_VAR + //arrange + _sb.Clear(); + expected := ''; + + //act + FOR i := 0 TO 8 DO + expected := CONCAT(expected,wordsToAppend[i],','); + _sb.Append(CONCAT(wordsToAppend[i],',')); + END_FOR; + + //assert + Assert.NotEqual(_sb.AsString(),''); + Assert.NotEqual(expected,''); + Assert.Equal(expected, _sb.AsString()); + END_METHOD + + {Test} + METHOD PUBLIC FluentApiWorks + //arrange/act + _sb.Clear().Append(1).Append(2).Append(3).Append(4).Clear().Append(1).Append(2).Append(3).Append(4); + + //assert + Assert.NotEqual(_sb.AsString(),''); + Assert.Equal('1234', _sb.AsString()); + END_METHOD + + {Test} + METHOD PUBLIC ClearMethodWillAbandonWorkingString + //arrange + _sb.Clear(); + //act + _sb.Append(1).Append(2).Append(3).Append(4); + Assert.Equal('1234', _sb.AsString()); + _sb.Clear(); + //assert + Assert.Equal(_sb.AsString(),''); + END_METHOD + + {Test} + METHOD PUBLIC WorksAsCSharpSb + //arrange + _sb.Clear(); + //act + _sb.Append('One').Clear().Append('Two').Append('Three'); + //assert + Assert.NotEqual(_sb.AsString(),''); + Assert.Equal('TwoThree', _sb.AsString()); + END_METHOD + + END_CLASS +END_NAMESPACE diff --git a/src/abstractions/src/AXOpen.Abstractions/ix_ax_axopen_abstractions.csproj b/src/abstractions/src/AXOpen.Abstractions/ix_ax_axopen_abstractions.csproj new file mode 100644 index 000000000..d025c6232 --- /dev/null +++ b/src/abstractions/src/AXOpen.Abstractions/ix_ax_axopen_abstractions.csproj @@ -0,0 +1,28 @@ + + + net6.0;net7.0 + enable + enable + AXOpen.Abstractions + AXOpen.Abstractions + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/abstractions/src/ix.framework.abstractions/Properties/AssemblyInfo.cs b/src/abstractions/src/ix.framework.abstractions/Properties/AssemblyInfo.cs deleted file mode 100644 index f835e5a79..000000000 --- a/src/abstractions/src/ix.framework.abstractions/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using System.Runtime.CompilerServices; - -[assembly:InternalsVisibleTo("ix.framework.core.tests")] \ No newline at end of file diff --git a/src/abstractions/src/ix.framework.abstractions/ix_ax_ix_framework_abstractions.csproj b/src/abstractions/src/ix.framework.abstractions/ix_ax_ix_framework_abstractions.csproj deleted file mode 100644 index d37ef2f3f..000000000 --- a/src/abstractions/src/ix.framework.abstractions/ix_ax_ix_framework_abstractions.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - net6.0 - enable - enable - - - - - - - - - - - \ No newline at end of file diff --git a/src/base/src/Ix.Base.Abstractions/Ix.Base.Abstractions.csproj b/src/base/src/Ix.Base.Abstractions/AXOpen.Base.Abstractions.csproj similarity index 97% rename from src/base/src/Ix.Base.Abstractions/Ix.Base.Abstractions.csproj rename to src/base/src/Ix.Base.Abstractions/AXOpen.Base.Abstractions.csproj index 88ae245ca..b6f5e95f0 100644 --- a/src/base/src/Ix.Base.Abstractions/Ix.Base.Abstractions.csproj +++ b/src/base/src/Ix.Base.Abstractions/AXOpen.Base.Abstractions.csproj @@ -12,6 +12,6 @@ - + diff --git a/src/base/src/Ix.Base.Abstractions/Data/DataBrowsers/DataBrowser.cs b/src/base/src/Ix.Base.Abstractions/Data/DataBrowsers/DataBrowser.cs index bf6de0c91..5864947e9 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/DataBrowsers/DataBrowser.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/DataBrowsers/DataBrowser.cs @@ -10,7 +10,7 @@ using AXSharp.Connector.ValueTypes; using AXSharp.Connector.ValueTypes.Online; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public class DataBrowser : IDataBrowser where T : IBrowsableDataObject, new() { diff --git a/src/base/src/Ix.Base.Abstractions/Data/DataBrowsers/IPlainExtensions.cs b/src/base/src/Ix.Base.Abstractions/Data/DataBrowsers/IPlainExtensions.cs index 2f238312f..64375f41b 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/DataBrowsers/IPlainExtensions.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/DataBrowsers/IPlainExtensions.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public static class IPlainExtensions { diff --git a/src/base/src/Ix.Base.Abstractions/Data/DataHelpers.cs b/src/base/src/Ix.Base.Abstractions/Data/DataHelpers.cs index 47e905c9f..02b4cef20 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/DataHelpers.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/DataHelpers.cs @@ -1,6 +1,6 @@ using System; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public static class DataHelpers { diff --git a/src/base/src/Ix.Base.Abstractions/Data/DataItemValidation.cs b/src/base/src/Ix.Base.Abstractions/Data/DataItemValidation.cs index 45682002c..140c8f793 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/DataItemValidation.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/DataItemValidation.cs @@ -1,4 +1,4 @@ -namespace Ix.Base.Data +namespace AXOpen.Base.Data { /// /// Provides basic information about the validation state. diff --git a/src/base/src/Ix.Base.Abstractions/Data/DateTimeProviders.cs b/src/base/src/Ix.Base.Abstractions/Data/DateTimeProviders.cs index e5e297e76..b6fb79eba 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/DateTimeProviders.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/DateTimeProviders.cs @@ -1,6 +1,6 @@ using System; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public static class DateTimeProviders { diff --git a/src/base/src/Ix.Base.Abstractions/Data/Exceptions/CrudExceptions.cs b/src/base/src/Ix.Base.Abstractions/Data/Exceptions/CrudExceptions.cs index 041b3443d..8123453ba 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/Exceptions/CrudExceptions.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/Exceptions/CrudExceptions.cs @@ -1,6 +1,6 @@ using System; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public class DuplicateIdException : Exception { diff --git a/src/base/src/Ix.Base.Abstractions/Data/Exceptions/IdentifierValueMismactchedException.cs b/src/base/src/Ix.Base.Abstractions/Data/Exceptions/IdentifierValueMismactchedException.cs index 28a3217eb..a99699540 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/Exceptions/IdentifierValueMismactchedException.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/Exceptions/IdentifierValueMismactchedException.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; using System.Security; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { /// /// Thrown when the id of the data structure does not match the required record/document id. diff --git a/src/base/src/Ix.Base.Abstractions/Data/IBrowsableDataObject.cs b/src/base/src/Ix.Base.Abstractions/Data/IBrowsableDataObject.cs index 0fc5fd938..95fa29eed 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/IBrowsableDataObject.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/IBrowsableDataObject.cs @@ -1,6 +1,6 @@ using System; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public interface IBrowsableDataObject { diff --git a/src/base/src/Ix.Base.Abstractions/Data/IRepository.cs b/src/base/src/Ix.Base.Abstractions/Data/IRepository.cs index 90532d5a6..edccc7348 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/IRepository.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/IRepository.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public delegate void OnCreateDelegate(string id, T data); public delegate void OnReadDelegate(string id); diff --git a/src/base/src/Ix.Base.Abstractions/Data/RepositoryBase.cs b/src/base/src/Ix.Base.Abstractions/Data/RepositoryBase.cs index 0eb85a686..ed2f5bd7b 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/RepositoryBase.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/RepositoryBase.cs @@ -4,7 +4,7 @@ using System.Runtime.Serialization; using System.Security; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { /// /// Base class for data repositories. diff --git a/src/base/src/Ix.Base.Abstractions/Data/RepositorySettings.cs b/src/base/src/Ix.Base.Abstractions/Data/RepositorySettings.cs index 41fbefe52..7700cfa7a 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/RepositorySettings.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/RepositorySettings.cs @@ -1,4 +1,4 @@ -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public abstract class RepositorySettings { diff --git a/src/base/src/Ix.Base.Abstractions/Data/SearchOptions.cs b/src/base/src/Ix.Base.Abstractions/Data/SearchOptions.cs index dff34343e..bfc657140 100644 --- a/src/base/src/Ix.Base.Abstractions/Data/SearchOptions.cs +++ b/src/base/src/Ix.Base.Abstractions/Data/SearchOptions.cs @@ -1,7 +1,7 @@ using System; using System.Linq; -namespace Ix.Base.Data +namespace AXOpen.Base.Data { public enum eSearchMode { diff --git a/src/core/ctrl/AXSharp.config.json b/src/core/ctrl/AXSharp.config.json index ebcbeb5c7..52b7500ea 100644 --- a/src/core/ctrl/AXSharp.config.json +++ b/src/core/ctrl/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"..\\src\\ix.framework.core"} \ No newline at end of file +{"OutputProjectFolder":"..\\src\\AXOpen.Core"} \ No newline at end of file diff --git a/src/core/ctrl/README.md b/src/core/ctrl/README.md index cb5df9cbc..2da3e32a3 100644 --- a/src/core/ctrl/README.md +++ b/src/core/ctrl/README.md @@ -4,11 +4,11 @@ # Basic concepts -## IxContext +## AxoContext -IxContext encapsulates entire application or application units. Any solution may contain one or more contexts, however the each should be considered to be an isolated island and any **direct inter-context access to members must be avoided**. +AxoContext encapsulates entire application or application units. Any solution may contain one or more contexts, however the each should be considered to be an isolated island and any **direct inter-context access to members must be avoided**. -**IMPORTANT** Each IxContext must belong to a single PLC task. Multiple IxContexts can be however running on the same task. +**IMPORTANT** Each AxoContext must belong to a single PLC task. Multiple IxContexts can be however running on the same task. ```mermaid @@ -19,17 +19,17 @@ IxContext encapsulates entire application or application units. Any solution may } ``` -In its basic implementation IxContext has relatively simple interface. The main method is the method where we place all calls of our sub-routines. **In other words the `Main` is the root of the call tree of our program.** +In its basic implementation AxoContext has relatively simple interface. The main method is the method where we place all calls of our sub-routines. **In other words the `Main` is the root of the call tree of our program.** -`Run` method runs the IxContext. It must be called cyclically within a program unit that is attached to a cyclic `task`. +`Run` method runs the AxoContext. It must be called cyclically within a program unit that is attached to a cyclic `task`. -### Why do we need IxContext +### Why do we need AxoContext - `IxContext` provides counters, object identification and other information about the execution of the program. These information is then used by the objects contained at different levels of the IxContext. + `AxoContext` provides counters, object identification and other information about the execution of the program. These information is then used by the objects contained at different levels of the AxoContext. -### How IxContext works +### How AxoContext works -When you call `Run` method on an instance of a IxContext, it will ensure opening IxContext, running `Main` method (root of all your program calls) and IxContext closing. +When you call `Run` method on an instance of a AxoContext, it will ensure opening AxoContext, running `Main` method (root of all your program calls) and AxoContext closing. ```mermaid @@ -39,27 +39,27 @@ When you call `Run` method on an instance of a IxContext, it will ensure opening id1(Open):::run-->id2(#Main*):::main-->id3(Close):::run-->id1 ``` -### How to use IxContext +### How to use AxoContext -Base class for the IxContext is `ix.core.IxContext`. The entry point of call execution of the IxContext is `Main` method. Notice that the `IxContext` class is abstract and cannot be instantiated if not extended. `Main` method must be overridden in derived class notice the use of override keyword and also that the method is `protected` which means the it is visible only from within the `IxContext` and derived classes. +Base class for the AxoContext is `ix.core.AxoContext`. The entry point of call execution of the AxoContext is `Main` method. Notice that the `AxoContext` class is abstract and cannot be instantiated if not extended. `Main` method must be overridden in derived class notice the use of override keyword and also that the method is `protected` which means the it is visible only from within the `AxoContext` and derived classes. - **How to extend IxContext class** + **How to extend AxoContext class** ~~~SmallTalk USING ix.core -CLASS PUBLIC MyContext EXTENDS IxContext +CLASS PUBLIC MyContext EXTENDS AxoContext METHOD PROTECTED OVERRIDE Main - // Here goes all your logic for given IxContext. + // Here goes all your logic for given AxoContext. END_METHOD END_CLASS ~~~ -Cyclical call of the IxContext logic (`Main` method) is ensured when IxContext `Execute` method is called. `Execute` method is public therefore accessible and visible to any part of the program that whishes to call it. +Cyclical call of the AxoContext logic (`Main` method) is ensured when AxoContext `Execute` method is called. `Execute` method is public therefore accessible and visible to any part of the program that whishes to call it. -**How to start IxContext's execution** +**How to start AxoContext's execution** ~~~SmallTalk PROGRAM MyProgram @@ -72,25 +72,25 @@ END_PROGRAM ~~~ -## IxObject +## AxoObject -IxObject is the base class for any other classes of ix.framework. It provides access to the parent IxObject and the IxContext in which it was initialized. +AxoObject is the base class for any other classes of ix.framework. It provides access to the parent AxoObject and the AxoContext in which it was initialized. ```mermaid classDiagram class Object{ - +Initialize(IIxContext context) - +Initialize(IIxObject parent) + +Initialize(IAxoContext context) + +Initialize(IAxoObject parent) } ``` -**IxObject initialization within a IxContext** +**AxoObject initialization within a AxoContext** ~~~SmallTalk - CLASS PUBLIC MyContext EXTENDS ix.core.IxContext + CLASS PUBLIC MyContext EXTENDS ix.core.AxoContext VAR - _myObject : ix.core.IxObject; + _myObject : ix.core.AxoObject; END_VAR METHOD PROTECTED OVERRIDE Main _myObject.Initialize(THIS); @@ -98,12 +98,12 @@ IxObject is the base class for any other classes of ix.framework. It provides ac END_CLASS ~~~ -**IxObject initialization within another IxObject** +**AxoObject initialization within another AxoObject** ~~~SmallTalk - CLASS PUBLIC MyParentObject EXTENDS ix.core.IxObject + CLASS PUBLIC MyParentObject EXTENDS ix.core.AxoObject VAR - _myChildObject : ix.core.IxObject; + _myChildObject : ix.core.AxoObject; END_VAR METHOD PROTECTED OVERRIDE Main _myChildObject.Initialize(THIS); @@ -111,16 +111,16 @@ IxObject is the base class for any other classes of ix.framework. It provides ac END_CLASS ~~~ -## IxTask +## AxoTask -IxTask provides basic task execution. IxTask needs to be initialized to set the proper IxContext. +AxoTask provides basic task execution. AxoTask needs to be initialized to set the proper AxoContext. -**IxTask initialization within a IxContext** +**AxoTask initialization within a AxoContext** ~~~SmallTalk - CLASS IxTaskExample EXTENDS IxContext + CLASS IxTaskExample EXTENDS AxoContext VAR PUBLIC - _myTask : IxTask; + _myTask : AxoTask; _myCounter : ULINT; END_VAR @@ -132,18 +132,18 @@ IxTask provides basic task execution. IxTask needs to be initialized to set the END_CLASS ~~~ -There are two key methods for managing the IxTask: +There are two key methods for managing the AxoTask: -- `Invoke()` fires the execution of the IxTask (can be called fire&forget or cyclically) -- `Execute()` method must be called cyclically. The method returns `TRUE` when the IxTask is required to run until enters `Done` state or terminates in error. +- `Invoke()` fires the execution of the AxoTask (can be called fire&forget or cyclically) +- `Execute()` method must be called cyclically. The method returns `TRUE` when the AxoTask is required to run until enters `Done` state or terminates in error. -For termination of the execution of the IxTask there are following methods: -- `DoneWhen(Done_Condition)` - terminates the execution of the IxTask and enters the `Done` state when the `Done_Condition` is `TRUE`. -- `ThrowWhen(Error_Condition)` - terminates the execution of the IxTask and enters the `Error` state when the `Error_Condition` is `TRUE`. -- `Abort()` - terminates the execution of the IxTask and enters the `Ready` state if the IxTask is in the `Busy` state, otherwise does nothing. +For termination of the execution of the AxoTask there are following methods: +- `DoneWhen(Done_Condition)` - terminates the execution of the AxoTask and enters the `Done` state when the `Done_Condition` is `TRUE`. +- `ThrowWhen(Error_Condition)` - terminates the execution of the AxoTask and enters the `Error` state when the `Error_Condition` is `TRUE`. +- `Abort()` - terminates the execution of the AxoTask and enters the `Ready` state if the AxoTask is in the `Busy` state, otherwise does nothing. -To reset the IxTask from any state in any moment there is following method: -- `Restore()` acts as reset of the IxTask (sets the state into `Ready` state from any state of the IxTask). +To reset the AxoTask from any state in any moment there is following method: +- `Restore()` acts as reset of the AxoTask (sets the state into `Ready` state from any state of the AxoTask). Moreover, there are seven more "event-like" methods that are called when a specific event occurs (see the chart below). @@ -211,11 +211,11 @@ flowchart TD end ``` -Example of using IxTask: +Example of using AxoTask: ~~~SmallTalk - CLASS IxTaskExample EXTENDS IxContext + CLASS IxTaskExample EXTENDS AxoContext VAR PUBLIC - _myTask : IxTask; + _myTask : AxoTask; _myCounter : ULINT; END_VAR @@ -235,21 +235,21 @@ Example of using IxTask: END_CLASS ~~~ -The IxTask executes upon the `Invoke` method call. `Invoke` fires the execution of `Execute` logic upon the first call, and it does not need cyclical calling. +The AxoTask executes upon the `Invoke` method call. `Invoke` fires the execution of `Execute` logic upon the first call, and it does not need cyclical calling. ~~~SmallTalk _myTask.Invoke(); ~~~ -`Invoke()` method returns IIxTaskState with the following members: +`Invoke()` method returns IAxoTaskState with the following members: - `IsBusy` indicates the execution started and is running. - `IsDone` indicates the execution completed with success. - `HasError` indicates the execution terminated with a failure. - - `IsAborted` indicates that the execution of the IxTask has been aborted. It should continue by calling the method `Resume()`. + - `IsAborted` indicates that the execution of the AxoTask has been aborted. It should continue by calling the method `Resume()`. ~~~SmallTalk - // Wait for IxTask to Complete + // Wait for AxoTask to Complete IF _myTask.Invoke().IsDone() THEN ; //Do something END_IF; @@ -261,29 +261,29 @@ The IxTask executes upon the `Invoke` method call. `Invoke` fires the execution ~~~ ~~~SmallTalk - // Make sure that the IxTask is executing + // Make sure that the AxoTask is executing IF _myTask.Invoke().IsBusy() THEN ; //Do something END_IF; ~~~ ~~~SmallTalk - // Check for IxTask's error + // Check for AxoTask's error IF _myTask.Invoke().HasError() THEN ; //Do something END_IF; ~~~ -The IxTask can be started only from the `Ready` state by calling the `Invoke()` method in the same Context cycle as the `Execute()` method is called, regardless the order of the methods calls. After IxTask completion, the state of the IxTask will remain in Done, unless: +The AxoTask can be started only from the `Ready` state by calling the `Invoke()` method in the same Context cycle as the `Execute()` method is called, regardless the order of the methods calls. After AxoTask completion, the state of the AxoTask will remain in Done, unless: -1.) IxTask's `Restore` method is called (IxTask changes it's state to `Ready` state). +1.) AxoTask's `Restore` method is called (AxoTask changes it's state to `Ready` state). 2.) `Invoke` method is not called for two or more consecutive cycles of its context (that usually means the same as PLC cycle); successive call of Invoke will switch the task into the Ready state and immediately into the `Kicking` state. -The IxTask may finish also in an `Error` state. In that case, the only possibility to get out of `Error` state is by calling the `Restore()` method. +The AxoTask may finish also in an `Error` state. In that case, the only possibility to get out of `Error` state is by calling the `Restore()` method. -To implement any of the already mentioned "event-like" methods the new class that extends from the IxTask needs to be created. The required method with `PROTECTED OVERRIDE` access modifier needs to be created as well, and the custom logic needs to be placed in. +To implement any of the already mentioned "event-like" methods the new class that extends from the AxoTask needs to be created. The required method with `PROTECTED OVERRIDE` access modifier needs to be created as well, and the custom logic needs to be placed in. These methods are: - `OnAbort()` - executes once when the task is aborted. - `OnResume()` - executes once when the task is resumed. @@ -336,56 +336,56 @@ Example of implementing "event-like" methods: ~~~ ## Step -IxStep is an extension class of the IxTask and provides the basics for the coordinated controlled execution of the task in the desired order based on the coordination mechanism used. +AxoStep is an extension class of the AxoTask and provides the basics for the coordinated controlled execution of the task in the desired order based on the coordination mechanism used. -IxStep contains the `Execute()` method so as its base class overloaded and extended by following parameters: +AxoStep contains the `Execute()` method so as its base class overloaded and extended by following parameters: -- coord (mandatory): instance of the coordination controlling the execution of the IxStep. -- Enable (optional): if this value is `FALSE`, IxStep body is not executed and the current order of the execution is incremented. -- Description (optional): IxStep description text describing the action the IxStep is providing. +- coord (mandatory): instance of the coordination controlling the execution of the AxoStep. +- Enable (optional): if this value is `FALSE`, AxoStep body is not executed and the current order of the execution is incremented. +- Description (optional): AxoStep description text describing the action the AxoStep is providing. -IxStep class contains following public members: +AxoStep class contains following public members: -- Order: Order of the IxStep in the coordination. This value can be set by calling the method `SetSteoOrder()` and read by the method `GetStepOrder()`. -- StepDescription: IxStep description text describing the action the IxStep is providing. This value can be set by calling the `Execute()` method with `Description` parameter. -- IsActive: if `TRUE`, the IxStep is currently executing, or is in the order of the execution, otherwise `FALSE`. This value can be set by calling the method `SetIsActive()` and read by the method `GetIsActive()`. -- IsEnabled: if `FALSE`, IxStep body is not executed and the current order of the execution is incremented. This value can be set by calling the method `SetIsEnabled()` or calling the `Execute()` method with `Enable` parameter and read by the method `GetIsEnabled()`. +- Order: Order of the AxoStep in the coordination. This value can be set by calling the method `SetSteoOrder()` and read by the method `GetStepOrder()`. +- StepDescription: AxoStep description text describing the action the AxoStep is providing. This value can be set by calling the `Execute()` method with `Description` parameter. +- IsActive: if `TRUE`, the AxoStep is currently executing, or is in the order of the execution, otherwise `FALSE`. This value can be set by calling the method `SetIsActive()` and read by the method `GetIsActive()`. +- IsEnabled: if `FALSE`, AxoStep body is not executed and the current order of the execution is incremented. This value can be set by calling the method `SetIsEnabled()` or calling the `Execute()` method with `Enable` parameter and read by the method `GetIsEnabled()`. -## IxSequencer +## AxoSequencer -IxSequencer is an IxCordinator class provides triggering the IxStep-s inside the sequence in the order they are written. +AxoSequencer is an IxCordinator class provides triggering the AxoStep-s inside the sequence in the order they are written. -IxSequencer extends from IxTask so it also has to be initialized by calling its `Initialize()` method and started using its `Invoke()` method. +AxoSequencer extends from AxoTask so it also has to be initialized by calling its `Initialize()` method and started using its `Invoke()` method. -IxSequencer contains following methods: -- `Open()`: this method must be called cyclically before any logic. It provides some configuration mechanism that ensures that the steps are going to be executed in the order, they are written. During the very first call of the sequence, no step is executed as the IxSequencer is in the configuring state. From the second context cycle after the IxSequencer has been invoked the IxSequencer change its state to running and starts the execution from the first step upto the last one. When IxSequencer is in running state, order of the step cannot be changed. -- `MoveNext()`: Terminates the currently executed step and moves the IxSequencer's pointer to the next step in order of execution. -- `RequestStep()`: Terminates the currently executed step and set the IxSequencer's pointer to the order of the `RequestedStep`. When the order of the `RequestedStep` is higher than the order of the currently finished step (the requested step is "after" the current one) the requested step is started in the same context cycle. When the order of the `RequestedStep` is lower than the order of the currently finished step (the requested step is "before" the current one) the requested step is started in the next context cycle. -- `CompleteSequence()`: Terminates the currently executed step, completes (finishes) the execution of this IxSequencer and set the coordination state to Idle. If the `SequenceMode` of the IxSequencer is set to `Cyclic`, following `Open()` method call in the next context cycle switch it again into the configuring state, reasign the order of the individual steps (even if the orders have been changed) and subsequently set IxSequencer back into the running state. If the `SequenceMode` of the IxSequencer is set to `RunOnce`, terminates also execution of the IxSequencer itself. -- `GetCoordinatorState()': Returns the current state of the IxSequencer. +AxoSequencer contains following methods: +- `Open()`: this method must be called cyclically before any logic. It provides some configuration mechanism that ensures that the steps are going to be executed in the order, they are written. During the very first call of the sequence, no step is executed as the AxoSequencer is in the configuring state. From the second context cycle after the AxoSequencer has been invoked the AxoSequencer change its state to running and starts the execution from the first step upto the last one. When AxoSequencer is in running state, order of the step cannot be changed. +- `MoveNext()`: Terminates the currently executed step and moves the AxoSequencer's pointer to the next step in order of execution. +- `RequestStep()`: Terminates the currently executed step and set the AxoSequencer's pointer to the order of the `RequestedStep`. When the order of the `RequestedStep` is higher than the order of the currently finished step (the requested step is "after" the current one) the requested step is started in the same context cycle. When the order of the `RequestedStep` is lower than the order of the currently finished step (the requested step is "before" the current one) the requested step is started in the next context cycle. +- `CompleteSequence()`: Terminates the currently executed step, completes (finishes) the execution of this AxoSequencer and set the coordination state to Idle. If the `SequenceMode` of the AxoSequencer is set to `Cyclic`, following `Open()` method call in the next context cycle switch it again into the configuring state, reasign the order of the individual steps (even if the orders have been changed) and subsequently set AxoSequencer back into the running state. If the `SequenceMode` of the AxoSequencer is set to `RunOnce`, terminates also execution of the AxoSequencer itself. +- `GetCoordinatorState()': Returns the current state of the AxoSequencer. - `Idle` - `Configuring`: assigning the orders to the steps, no step is executed. - `Running`: orders to the steps are already assigned, step is executed. -- `SetSteppingMode()`: Sets the stepping mode of the IxSequencer. Following values are possible. +- `SetSteppingMode()`: Sets the stepping mode of the AxoSequencer. Following values are possible. - `None`: - `StepByStep`: if this mode is choosen, each step needs to be started by the invocation of the `StepIn` commmand. - `Continous`: if this mode is choosen (default), each step is started automaticcaly after the previous one has been completed. -- `GetSteppingMode()`: Gets the current stepping mode of the IxSequencer. -- `SetSequenceMode()`: Sets the sequence mode of the IxSequencer. Following values are possible. +- `GetSteppingMode()`: Gets the current stepping mode of the AxoSequencer. +- `SetSequenceMode()`: Sets the sequence mode of the AxoSequencer. Following values are possible. - `None`: - `RunOnce`: if this mode is choosen, after calling the method `CompleteSequence()` the execution of the sequence is terminated. - `Cyclic`: if this mode is choosen (default), after calling the method `CompleteSequence()` the execution of the sequence is "reordered" and started from beginning. -- `GetSequenceMode()`: Gets the current sequence mode of the IxSequencer. +- `GetSequenceMode()`: Gets the current sequence mode of the AxoSequencer. - `GetNumberOfConfiguredSteps()`: Gets the number of the configured steps in the sequence. ~~~SmallTalk - CLASS IxSequencerExample EXTENDS IxContext + CLASS IxSequencerExample EXTENDS AxoContext VAR PUBLIC - _mySequencer : IxSequencer; - _step_1 : IxStep; - _step_2 : IxStep; - _step_3 : IxStep; + _mySequencer : AxoSequencer; + _step_1 : AxoStep; + _step_2 : AxoStep; + _step_3 : AxoStep; _myCounter : ULINT; END_VAR @@ -436,37 +436,37 @@ IxSequencer contains following methods: ~~~ -## IxComponent +## AxoComponent -`IxComponent` is an abstract class extending the IxObject, and it is the base building block for the "hardware-related devices" like a pneumatic piston, servo drive, robot, etc., so as for the, let's say, "virtual devices" like counter, database, etc. `IxComponent` is designed to group all possible methods, tasks, settings, and status information into one consistent class. As the `IxComponent` is an abstract class, it cannot be instantiated and must be extended. In the extended class, two methods are mandatory. +`AxoComponent` is an abstract class extending the AxoObject, and it is the base building block for the "hardware-related devices" like a pneumatic piston, servo drive, robot, etc., so as for the, let's say, "virtual devices" like counter, database, etc. `AxoComponent` is designed to group all possible methods, tasks, settings, and status information into one consistent class. As the `AxoComponent` is an abstract class, it cannot be instantiated and must be extended. In the extended class, two methods are mandatory. -`Restore()` - inside this method, the logic for resetting the IxComponent or restoring it from any state to its initial state should be placed. +`Restore()` - inside this method, the logic for resetting the AxoComponent or restoring it from any state to its initial state should be placed. -`ManualControl()` - inside this method, the logic for manual operations with the component should be placed. To be able to control the `IxComponent` instance manually, the method `ActivateManualControl()` of this instance needs to be called cyclically. +`ManualControl()` - inside this method, the logic for manual operations with the component should be placed. To be able to control the `AxoComponent` instance manually, the method `ActivateManualControl()` of this instance needs to be called cyclically. -The base class contains two additional method to deal with the manual control of the `IxComponent`. -`ActivateManualControl()` - when this method is called cyclically, the `IxComponent` changes its behavior to manually controllable and ensure the call of the `ManualControl()` method in the derived class. +The base class contains two additional method to deal with the manual control of the `AxoComponent`. +`ActivateManualControl()` - when this method is called cyclically, the `AxoComponent` changes its behavior to manually controllable and ensure the call of the `ManualControl()` method in the derived class. -`IsManuallyControllable()` -returns `TRUE` when the `IxComponent` is manually controllable. +`IsManuallyControllable()` -returns `TRUE` when the `AxoComponent` is manually controllable. **Layout attributes `ComponentHeader` and `ComponentDetails`** -The visual view of the extended `IxComponent` on the UI side could be done both ways. Manually with complete control over the design or by using the auto-rendering mechanism of the `RenderableContentControl` (TODO add a link to docu of the RenderableContentControl) element, which is, in most cases, more than perfect. +The visual view of the extended `AxoComponent` on the UI side could be done both ways. Manually with complete control over the design or by using the auto-rendering mechanism of the `RenderableContentControl` (TODO add a link to docu of the RenderableContentControl) element, which is, in most cases, more than perfect. To take full advantage of the auto-rendering mechanism, the base class has implemented the additional layout attributes `ComponentHeader` and `ComponentDetails(TabName)`. The auto-rendered view is divided into two parts: the fixed one and the expandable one. -All `IxComponent` members with the `ComponentHeader` layout attribute defined will be displayed in the fixed part. +All `AxoComponent` members with the `ComponentHeader` layout attribute defined will be displayed in the fixed part. All members with the `ComponentDetails(TabName)` layout attribute defined will be displayed in the expandable part inside the `TabControl` with "TabName". All members are added in the order in which they are defined, taking into account their layout attributes like `Container(Layout.Wrap)` or `Container(Layout.Stack)`. -**How to implement `IxComponent`** +**How to implement `AxoComponent`** -Example of the implementation very simple `IxComponent` with members placed only inside the Header. +Example of the implementation very simple `AxoComponent` with members placed only inside the Header. ~~~SmallTalk -using ix.framework.core; +using AXOpen.Core; {#ix-attr:[Container(Layout.Stack)]} {#ix-set:AttributeName = "Component with header only example"} -CLASS PUBLIC ComponentHeaderOnlyExample EXTENDS IxComponent - METHOD PROTECTED OVERRIDE Restore: IIxTask +CLASS PUBLIC ComponentHeaderOnlyExample EXTENDS AxoComponent + METHOD PROTECTED OVERRIDE Restore: IAxoTask // Some logic for Restore could be placed here. // For Example: valueReal := REAL#0.0; @@ -478,10 +478,10 @@ CLASS PUBLIC ComponentHeaderOnlyExample EXTENDS IxComponent ; END_METHOD - // Main method of the `IxComponent` that needs to be called inside the `IxContext` cyclically. + // Main method of the `AxoComponent` that needs to be called inside the `AxoContext` cyclically. METHOD PUBLIC Run // Declaration of the input and output variables. - // In the case of "hardware-related" `IxComponent`, + // In the case of "hardware-related" `AxoComponent`, // these would be the variables linked to the hardware. VAR_INPUT inReal : REAL; @@ -515,18 +515,18 @@ CLASS PUBLIC ComponentHeaderOnlyExample EXTENDS IxComponent END_CLASS ~~~ -**How to use `IxComponent`** +**How to use `AxoComponent`** -The instance of the extended `IxComponent` must be defined inside the `IxContext`. +The instance of the extended `AxoComponent` must be defined inside the `AxoContext`. ~~~SmallTalk -.....................EXTENDS ix.framework.core.IxContext +.....................EXTENDS AxoContext VAR PUBLIC {#ix-set:AttributeName = "Very simple component example with header only defined"} MyComponentWithHeaderOnly : ComponentHeaderOnlyExample; END_VAR ~~~ -Inside the `Main()` method of the related `IxContext` following rules must be applied. The `Initialize()` method of the extended instance of the `IxComponent` must be called first. +Inside the `Main()` method of the related `AxoContext` following rules must be applied. The `Initialize()` method of the extended instance of the `AxoComponent` must be called first. The `Run()` method with the respective input and output variables must be called afterwards. ~~~SmallTalk diff --git a/src/core/ctrl/apax.yml b/src/core/ctrl/apax.yml index 1d34c7f3c..8cf885525 100644 --- a/src/core/ctrl/apax.yml +++ b/src/core/ctrl/apax.yml @@ -1,5 +1,5 @@ -name: "@ix-ax/ix.framework.core" -version : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' +name: "@ix-ax/axopen.core" +version : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' type: lib targets: # - "1500" @@ -19,5 +19,5 @@ dependencies: "@ax/system-serde": ^1.3.13 "@ax/system-bitaccess": ^5.0.4 "@ax/system-datetime": ^3.1.3 - "@ix-ax/ix.framework.abstractions" : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' + "@ix-ax/axopen.abstractions" : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' diff --git a/src/core/ctrl/src/IxComponent/IxComponent.st b/src/core/ctrl/src/AxoComponent/AxoComponent.st similarity index 86% rename from src/core/ctrl/src/IxComponent/IxComponent.st rename to src/core/ctrl/src/AxoComponent/AxoComponent.st index 93ebcc470..95ae5ea73 100644 --- a/src/core/ctrl/src/IxComponent/IxComponent.st +++ b/src/core/ctrl/src/AxoComponent/AxoComponent.st @@ -1,6 +1,6 @@ -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core - CLASS PUBLIC ABSTRACT IxComponent EXTENDS IxObject IMPLEMENTS IIxComponent + CLASS PUBLIC ABSTRACT AxoComponent EXTENDS AxoObject IMPLEMENTS IAxoComponent /// /// Executes the logic for manual-maintenance control. /// @@ -14,8 +14,8 @@ NAMESPACE ix.framework.core END_METHOD /// - /// Gets whether the IxComponent is manually controllable. - /// To make the IxComponent manually controllable, it is necessary to call the `ActivateManualMode()` method cyclically. + /// Gets whether the AxoComponent is manually controllable. + /// To make the AxoComponent manually controllable, it is necessary to call the `ActivateManualMode()` method cyclically. /// METHOD PUBLIC FINAL IsManuallyControllable: BOOL THIS.CheckIfManualControlIsActivated(); @@ -25,11 +25,11 @@ NAMESPACE ix.framework.core /// /// Restores this instance. This method must be implemented in derived class. /// - METHOD PROTECTED ABSTRACT Restore: IIxTask + METHOD PROTECTED ABSTRACT Restore: IAxoTask END_METHOD /// - /// Custom logic for manual control of the IxComponent. + /// Custom logic for manual control of the AxoComponent. /// This method must be implemented in derived class. /// METHOD PROTECTED ABSTRACT ManualControl diff --git a/src/core/ctrl/src/IxContext/IxContext.st b/src/core/ctrl/src/AxoContext/AxoContext.st similarity index 82% rename from src/core/ctrl/src/IxContext/IxContext.st rename to src/core/ctrl/src/AxoContext/AxoContext.st index b35de164b..86ab55070 100644 --- a/src/core/ctrl/src/IxContext/IxContext.st +++ b/src/core/ctrl/src/AxoContext/AxoContext.st @@ -1,18 +1,18 @@ -USING ix.framework.rtc; -USING ix.framework.messaging; +USING AXOpen.Rtc; +USING AXOpen.Messaging; -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core /// - /// Provides base for contextualized entry of `ix.framework` application. + /// Provides base for contextualized entry of `AXOpen` application. /// This class is abstract and must be inherited. /// - CLASS PUBLIC ABSTRACT IxContext IMPLEMENTS IIxContext + CLASS PUBLIC ABSTRACT AxoContext IMPLEMENTS IAxoContext VAR PRIVATE _openCounter : ULINT; _closeCounter : ULINT; _identityCounter : ULINT; - _messagingLevel : eIxMessageCategory; - _environment : IIxContextEnvironment; + _messagingLevel : eAxoMessageCategory; + _environment : IAxoContextEnvironment; END_VAR /// @@ -63,10 +63,10 @@ NAMESPACE ix.framework.core VAR PRIVATE NULL_RTC : _NULL_RTC; - _rtc : IRtc; + _rtc : IAxoRtc; END_VAR - METHOD PUBLIC GetRtc : IRtc + METHOD PUBLIC GetRtc : IAxoRtc IF(_rtc <> NULL) THEN GetRtc := _rtc; ELSE @@ -76,18 +76,18 @@ NAMESPACE ix.framework.core METHOD PUBLIC InjectRtc VAR_INPUT - Rtc : IRtc; + Rtc : IAxoRtc; END_VAR _rtc := Rtc; END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment Environment := _environment; END_METHOD // METHOD PUBLIC SetContextEnvironment // VAR_INPUT - // inContextEnvironnment : IIxContextEnvironment; + // inContextEnvironnment : IAxoContextEnvironment; // END_VAR // _contextEnvironment := inContextEnvironnment; // END_METHOD @@ -96,7 +96,7 @@ NAMESPACE ix.framework.core /// /// Provides an empty RTC object for uninitialized RTC. /// - CLASS PUBLIC _NULL_RTC IMPLEMENTS IRtc + CLASS PUBLIC _NULL_RTC IMPLEMENTS IAxoRtc VAR PRIVATE _null_time : LDATE_AND_TIME := LDATE_AND_TIME#1970-01-01-00:00:00.000; END_VAR diff --git a/src/core/ctrl/src/AxoContext/AxoContextEnvironment.st b/src/core/ctrl/src/AxoContext/AxoContextEnvironment.st new file mode 100644 index 000000000..e10918c6d --- /dev/null +++ b/src/core/ctrl/src/AxoContext/AxoContextEnvironment.st @@ -0,0 +1,12 @@ +USING AXOpen.Messaging; + +NAMESPACE AXOpen.Core + CLASS PUBLIC AxoContextEnvironment IMPLEMENTS IAxoContextEnvironment + VAR PRIVATE + _messenger : AxoMessengerEnv; + END_VAR + METHOD PUBLIC Messaging : IAxoMessengerEnv + Messaging := _messenger; + END_METHOD + END_CLASS +END_NAMESPACE diff --git a/src/core/ctrl/src/IxCoordination/IxSequencer/IxSequencer.st b/src/core/ctrl/src/AxoCoordination/AxoSequencer/AxoSequencer.st similarity index 81% rename from src/core/ctrl/src/IxCoordination/IxSequencer/IxSequencer.st rename to src/core/ctrl/src/AxoCoordination/AxoSequencer/AxoSequencer.st index 83d001075..af6bba74d 100644 --- a/src/core/ctrl/src/IxCoordination/IxSequencer/IxSequencer.st +++ b/src/core/ctrl/src/AxoCoordination/AxoSequencer/AxoSequencer.st @@ -1,23 +1,23 @@ -NAMESPACE ix.framework.core - CLASS IxSequencer EXTENDS IxTask IMPLEMENTS IIxSequencer +NAMESPACE AXOpen.Core + CLASS AxoSequencer EXTENDS AxoTask IMPLEMENTS IAxoSequencer VAR PUBLIC {#ix-set:AttributeName = "<#Stepping mode#>"} - SteppingMode : eIxSteppingMode; + SteppingMode : eAxoSteppingMode; {#ix-set:AttributeName = "<#Sequence mode#>"} - SequenceMode : eIxSequenceMode; + SequenceMode : eAxoSequenceMode; CurrentOrder : ULINT; {#ix-set:AttributeName = ">>"} - StepForwardCommand : IxTask; + StepForwardCommand : AxoTask; {#ix-set:AttributeName = "<#Run step#>"} - StepIn : IxTask; + StepIn : AxoTask; {#ix-set:AttributeName = "<<"} - StepBackwardCommand : IxTask; + StepBackwardCommand : AxoTask; END_VAR VAR PRIVATE _configurationFlowOrder : ULINT; _numberOfConfiguredSteps : ULINT; - _coordinatorState : CoordinatorStates; - _step : IIxStep; + _coordinatorState : AxoCoordinatorStates; + _step : IAxoStep; _openCycleCounter : ULINT; _closeCycleCounter : ULINT; END_VAR @@ -32,24 +32,24 @@ NAMESPACE ix.framework.core IF THIS. InvalidContext() THEN RETURN; END_IF; _openCycleCounter := THIS.GetContext().OpenCycleCount(); CASE _coordinatorState OF - CoordinatorStates#Idle : + AxoCoordinatorStates#Idle : _configurationFlowOrder := ULINT#0; _numberOfConfiguredSteps := ULINT#0; - _coordinatorState := CoordinatorStates#Configuring; + _coordinatorState := AxoCoordinatorStates#Configuring; StepForwardCommand.Initialize(THIS.GetContext()); StepIn.Initialize(THIS.GetContext()); StepBackwardCommand.Initialize(THIS.GetContext()); - CoordinatorStates#Configuring : + AxoCoordinatorStates#Configuring : THIS.OnBeforeSequenceStart(); CurrentOrder := ULINT#1; - _coordinatorState := CoordinatorStates#Running; + _coordinatorState := AxoCoordinatorStates#Running; END_CASE; END_IF; END_METHOD METHOD INTERNAL Execute : BOOL VAR_INPUT - step : IIxStep; + step : IAxoStep; Enable : BOOL; END_VAR @@ -61,9 +61,9 @@ NAMESPACE ix.framework.core THIS.DetermineOrder(step); // Stepping inside the sequence - IF _coordinatorState = CoordinatorStates#Running THEN + IF _coordinatorState = AxoCoordinatorStates#Running THEN // Stepping is possible only in StepByStepMode - IF SteppingMode = eIxSteppingMode#StepByStep THEN + IF SteppingMode = eAxoSteppingMode#StepByStep THEN // Stepping Forwards and Backwards commands cannot be executed simultaneously StepForwardCommand.IsDisabled := StepBackwardCommand.IsBusy() // Stepping Forwards disabled from last step @@ -95,13 +95,13 @@ NAMESPACE ix.framework.core THIS.DisableAllSteppingComands(); END_IF; - IF _coordinatorState = CoordinatorStates#Running AND (CurrentOrder = step.GetStepOrder()) AND step.IsCalledJustOnceInThisPlcCycle() THEN + IF _coordinatorState = AxoCoordinatorStates#Running AND (CurrentOrder = step.GetStepOrder()) AND step.IsCalledJustOnceInThisPlcCycle() THEN IF Enable THEN step.SetIsActive(TRUE); ELSE CurrentOrder := CurrentOrder + ULINT#1; // Finalize the StepIn Command in a case of step mode - StepIn.DoneWhen(SteppingMode = eIxSteppingMode#StepByStep); + StepIn.DoneWhen(SteppingMode = eAxoSteppingMode#StepByStep); END_IF; ELSE step.SetIsActive(FALSE); @@ -113,11 +113,11 @@ NAMESPACE ix.framework.core step.SetIsDisabled(NOT step.GetIsActive()); END_IF; - IF step.GetIsActive() AND (step.IsReady() OR step.IsDone() OR SteppingMode = eIxSteppingMode#StepByStep) THEN - IF (SteppingMode = eIxSteppingMode#Continous) THEN + IF step.GetIsActive() AND (step.IsReady() OR step.IsDone() OR SteppingMode = eAxoSteppingMode#StepByStep) THEN + IF (SteppingMode = eAxoSteppingMode#Continous) THEN step.Invoke(); // Invoke the step in a case of step mode when StepIn Command is invoked - ELSIF (SteppingMode = eIxSteppingMode#StepByStep) THEN + ELSIF (SteppingMode = eAxoSteppingMode#StepByStep) THEN IF StepIn.Execute() THEN IF _step.HasError() THEN _step.Restore(); @@ -137,12 +137,12 @@ NAMESPACE ix.framework.core METHOD PUBLIC MoveNext IF SUPER.Execute() THEN IF THIS.InvalidContext(_step) THEN RETURN; END_IF; - IF _coordinatorState = CoordinatorStates#Running THEN + IF _coordinatorState = AxoCoordinatorStates#Running THEN _step.DoneWhen(_step.IsBusy()); _step.SetIsActive(FALSE); CurrentOrder := CurrentOrder + ULINT#1; // Finalize the StepIn Command in a case of step mode - StepIn.DoneWhen(SteppingMode = eIxSteppingMode#StepByStep); + StepIn.DoneWhen(SteppingMode = eAxoSteppingMode#StepByStep); END_IF; END_IF; END_METHOD @@ -152,17 +152,17 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC RequestStep VAR_INPUT - RequestedStep : IIxStep; + RequestedStep : IAxoStep; END_VAR IF SUPER.Execute() THEN IF THIS.InvalidContext(RequestedStep) THEN RETURN; END_IF; IF RequestedStep.GetStepOrder() <> ULINT#0 AND - _coordinatorState = CoordinatorStates#Running THEN + _coordinatorState = AxoCoordinatorStates#Running THEN _step.DoneWhen(_step.IsBusy()); _step.SetIsActive(FALSE); CurrentOrder := RequestedStep.GetStepOrder(); // Finalize the StepIn Command in a case of step mode - StepIn.DoneWhen(SteppingMode = eIxSteppingMode#StepByStep); + StepIn.DoneWhen(SteppingMode = eAxoSteppingMode#StepByStep); END_IF; END_IF; END_METHOD @@ -174,14 +174,14 @@ NAMESPACE ix.framework.core METHOD PUBLIC CompleteSequence IF SUPER.Execute() THEN IF THIS.InvalidContext(_step) THEN RETURN; END_IF; - IF _coordinatorState = CoordinatorStates#Running THEN + IF _coordinatorState = AxoCoordinatorStates#Running THEN _step.DoneWhen(TRUE); _step.SetIsActive(FALSE); - _coordinatorState := CoordinatorStates#Idle; + _coordinatorState := AxoCoordinatorStates#Idle; CurrentOrder := ULINT#1; - SUPER.DoneWhen(SequenceMode =eIxSequenceMode#RunOnce); + SUPER.DoneWhen(SequenceMode =eAxoSequenceMode#RunOnce); // Finalize the StepIn Command in a case of step mode - StepIn.DoneWhen(SteppingMode = eIxSteppingMode#StepByStep); + StepIn.DoneWhen(SteppingMode = eAxoSteppingMode#StepByStep); THIS.OnCompleteSequence(); END_IF; END_IF; @@ -203,16 +203,16 @@ NAMESPACE ix.framework.core /// /// Gets the state of the coordinator /// - METHOD PUBLIC GetCoordinatorState : CoordinatorStates + METHOD PUBLIC GetCoordinatorState : AxoCoordinatorStates GetCoordinatorState := _coordinatorState; END_METHOD METHOD PROTECTED DetermineOrder : ULINT VAR_INPUT - step : IIxStep; + step : IAxoStep; END_VAR - IF(_coordinatorState = CoordinatorStates#Configuring) THEN + IF(_coordinatorState = AxoCoordinatorStates#Configuring) THEN step.Restore(); _step := step; _configurationFlowOrder := _configurationFlowOrder + ULINT#1; @@ -220,7 +220,7 @@ NAMESPACE ix.framework.core step.SetStepOrder(THIS,_configurationFlowOrder); IF NOT step.IsCalledJustOnceInThisPlcCycle() THEN - _coordinatorState := CoordinatorStates#Idle; + _coordinatorState := AxoCoordinatorStates#Idle; step.SetStepOrder(THIS,ULINT#0); END_IF; END_IF; @@ -232,7 +232,7 @@ NAMESPACE ix.framework.core /// Gets the number of the configured steps in the sequence. /// METHOD PUBLIC GetNumberOfConfiguredSteps : ULINT - IF _coordinatorState = CoordinatorStates#Running THEN + IF _coordinatorState = AxoCoordinatorStates#Running THEN _numberOfConfiguredSteps := _configurationFlowOrder; GetNumberOfConfiguredSteps := _numberOfConfiguredSteps; ELSE @@ -250,7 +250,7 @@ NAMESPACE ix.framework.core METHOD PROTECTED InvalidContext : BOOL VAR_INPUT - step : IIxStep; + step : IAxoStep; END_VAR IF THIS.GetContext() = NULL THEN InvalidContext := TRUE; // TODO: We will need to message this, when messaging ready. @@ -282,7 +282,7 @@ NAMESPACE ix.framework.core METHOD PROTECTED OVERRIDE OnRestore _configurationFlowOrder := ULINT#0; _numberOfConfiguredSteps := ULINT#0; - _coordinatorState := CoordinatorStates#Idle; + _coordinatorState := AxoCoordinatorStates#Idle; END_METHOD END_CLASS END_NAMESPACE diff --git a/src/core/ctrl/src/IxCoordination/IxSequencer/eIxSequenceMode.st b/src/core/ctrl/src/AxoCoordination/AxoSequencer/eAxoSequenceMode.st similarity index 73% rename from src/core/ctrl/src/IxCoordination/IxSequencer/eIxSequenceMode.st rename to src/core/ctrl/src/AxoCoordination/AxoSequencer/eAxoSequenceMode.st index f7965a1e4..f861e590f 100644 --- a/src/core/ctrl/src/IxCoordination/IxSequencer/eIxSequenceMode.st +++ b/src/core/ctrl/src/AxoCoordination/AxoSequencer/eAxoSequenceMode.st @@ -1,6 +1,6 @@ -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core TYPE PUBLIC - eIxSequenceMode : INT + eAxoSequenceMode : INT ( None := 0, RunOnce := 1, diff --git a/src/core/ctrl/src/IxCoordination/IxSequencer/eIxSteppingMode.st b/src/core/ctrl/src/AxoCoordination/AxoSequencer/eAxoSteppingMode.st similarity index 74% rename from src/core/ctrl/src/IxCoordination/IxSequencer/eIxSteppingMode.st rename to src/core/ctrl/src/AxoCoordination/AxoSequencer/eAxoSteppingMode.st index ac5ab67e5..2cad429f7 100644 --- a/src/core/ctrl/src/IxCoordination/IxSequencer/eIxSteppingMode.st +++ b/src/core/ctrl/src/AxoCoordination/AxoSequencer/eAxoSteppingMode.st @@ -1,6 +1,6 @@ -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core TYPE PUBLIC - eIxSteppingMode : INT + eAxoSteppingMode : INT ( None := 0, StepByStep := 1, diff --git a/src/core/ctrl/src/IxCoordination/IxStep/IxStep.st b/src/core/ctrl/src/AxoCoordination/AxoStep/AxoStep.st similarity index 89% rename from src/core/ctrl/src/IxCoordination/IxStep/IxStep.st rename to src/core/ctrl/src/AxoCoordination/AxoStep/AxoStep.st index f8f8d4709..795c2625d 100644 --- a/src/core/ctrl/src/IxCoordination/IxStep/IxStep.st +++ b/src/core/ctrl/src/AxoCoordination/AxoStep/AxoStep.st @@ -1,6 +1,6 @@ -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core {#ix-prop: public string Description} - CLASS IxStep EXTENDS IxTask IMPLEMENTS IIxStep + CLASS AxoStep EXTENDS AxoTask IMPLEMENTS IAxoStep VAR PUBLIC {#ix-attr:[ReadOnly()]} Order : ULINT; @@ -29,10 +29,10 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC SetStepOrder VAR_INPUT - coord : IIxCoordinator; + coord : IAxoCoordinator; StepOrder : ULINT; END_VAR; - IF coord <> NULL AND coord.GetCoordinatorState() = CoordinatorStates#Configuring OR StepOrder = ULINT#0 THEN + IF coord <> NULL AND coord.GetCoordinatorState() = AxoCoordinatorStates#Configuring OR StepOrder = ULINT#0 THEN Order := StepOrder; END_IF; END_METHOD @@ -49,7 +49,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC Execute : BOOL VAR_INPUT - coord : IIxCoordinator; + coord : IAxoCoordinator; END_VAR Execute := THIS.ExecuteInternal(coord,TRUE); END_METHOD @@ -59,7 +59,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC Execute : BOOL VAR_INPUT - coord : IIxCoordinator; + coord : IAxoCoordinator; Enable : BOOL; END_VAR Execute := THIS.ExecuteInternal(coord,Enable); @@ -71,7 +71,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC Execute : BOOL VAR_INPUT - coord : IIxCoordinator; + coord : IAxoCoordinator; Enable : BOOL; Description : STRING[120]; END_VAR @@ -85,7 +85,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC Execute : BOOL VAR_INPUT - coord : IIxCoordinator; + coord : IAxoCoordinator; Description : STRING[120]; END_VAR StepDescription := Description; @@ -108,11 +108,11 @@ NAMESPACE ix.framework.core METHOD PROTECTED ExecuteInternal : BOOL VAR_INPUT - coord : IIxCoordinator; + coord : IAxoCoordinator; Enable : BOOL; END_VAR VAR - Sequencer : REF_TO IxSequencer; + Sequencer : REF_TO AxoSequencer; // Selector : REF_TO Selector; END_VAR diff --git a/src/core/ctrl/src/IxObject/IxObject.st b/src/core/ctrl/src/AxoObject/AxoObject.st similarity index 80% rename from src/core/ctrl/src/IxObject/IxObject.st rename to src/core/ctrl/src/AxoObject/AxoObject.st index 66ea0c173..7669224b1 100644 --- a/src/core/ctrl/src/IxObject/IxObject.st +++ b/src/core/ctrl/src/AxoObject/AxoObject.st @@ -1,10 +1,10 @@ -USING ix.framework.rtc; +USING AXOpen.Rtc; -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core FUNCTION IsNullContext : BOOL VAR_INPUT - Context : IIxContext; + Context : IAxoContext; END_VAR IF Context = NULL THEN IsNullContext := TRUE; @@ -18,17 +18,17 @@ NAMESPACE ix.framework.core /// /// Provides an empty context for uninitialized objects. /// - CLASS PUBLIC _NULL_CONTEXT IMPLEMENTS IIxContext + CLASS PUBLIC _NULL_CONTEXT IMPLEMENTS IAxoContext VAR PRIVATE NULL_RTC : _NULL_RTC; END_VAR METHOD PUBLIC CreateIdentity : ULINT CreateIdentity := ULINT#0; END_METHOD METHOD PUBLIC OpenCycleCount : ULINT OpenCycleCount := ULINT#0; END_METHOD - METHOD PUBLIC GetRtc : IRtc GetRtc := NULL_RTC; END_METHOD - METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IRtc; END_VAR ; END_METHOD + METHOD PUBLIC GetRtc : IAxoRtc GetRtc := NULL_RTC; END_METHOD + METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IAxoRtc; END_VAR ; END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment ; END_METHOD END_CLASS @@ -36,22 +36,22 @@ NAMESPACE ix.framework.core /// /// Provides an empty object for uninitialized objects. /// - CLASS PUBLIC _NULL_OBJECT IMPLEMENTS IIxObject + CLASS PUBLIC _NULL_OBJECT IMPLEMENTS IAxoObject VAR PRIVATE NULL_CONTEXT : _NULL_CONTEXT; END_VAR METHOD PUBLIC GetIdentity : ULINT GetIdentity := ULINT#0; END_METHOD - METHOD PUBLIC GetContext : IIxContext + METHOD PUBLIC GetContext : IAxoContext GetContext := NULL_CONTEXT; END_METHOD END_CLASS /// - /// Provides base class for all classes of `ix.framework`. + /// Provides base class for all classes of `AXOpen`. /// - CLASS PUBLIC IxObject IMPLEMENTS IIxObject + CLASS PUBLIC AxoObject IMPLEMENTS IAxoObject VAR PUBLIC {#ix-attr:[CompilerOmits("POCO")]} {#ix-attr:[ReadOnly()]} @@ -59,8 +59,8 @@ NAMESPACE ix.framework.core END_VAR VAR PRIVATE - _parent : IIxObject; - _context : IIxContext; + _parent : IAxoObject; + _context : IAxoContext; END_VAR VAR PRIVATE @@ -78,7 +78,7 @@ NAMESPACE ix.framework.core /// /// Gets context in which this object was initialized. /// - METHOD PUBLIC GetContext : IIxContext + METHOD PUBLIC GetContext : IAxoContext IF(_context <> NULL) THEN GetContext := _context; ELSE @@ -89,7 +89,7 @@ NAMESPACE ix.framework.core /// /// Gets parent in which this object was initialized. /// - METHOD PUBLIC GetParent : IIxObject + METHOD PUBLIC GetParent : IAxoObject IF(_context <> NULL) THEN GetParent := _parent; ELSE @@ -104,7 +104,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC Initialize VAR_INPUT - parent : IIxObject; + parent : IAxoObject; END_VAR IF(Identity = ULINT#0 AND parent <> NULL) THEN @@ -123,7 +123,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC Initialize VAR_INPUT - context : IIxContext; + context : IAxoContext; END_VAR IF(Identity = ULINT#0 AND context <> NULL) THEN @@ -133,13 +133,13 @@ NAMESPACE ix.framework.core END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment Environment := THIS.GetContext().Environment(); END_METHOD // METHOD PUBLIC SetContextEnvironment // VAR_INPUT - // inContextEnvironnment : IIxContextEnvironment; + // inContextEnvironnment : IAxoContextEnvironment; // END_VAR // _contextEnvironment := inContextEnvironnment; // END_METHOD diff --git a/src/core/ctrl/src/IxRemoteTask/IxRemoteTask.st b/src/core/ctrl/src/AxoRemoteTask/AxoRemoteTask.st similarity index 96% rename from src/core/ctrl/src/IxRemoteTask/IxRemoteTask.st rename to src/core/ctrl/src/AxoRemoteTask/AxoRemoteTask.st index 832d5344e..ebabcb413 100644 --- a/src/core/ctrl/src/IxRemoteTask/IxRemoteTask.st +++ b/src/core/ctrl/src/AxoRemoteTask/AxoRemoteTask.st @@ -1,4 +1,4 @@ -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core /// /// Provides a mechanism to exectute a logic from the PLC in an .NET environment. /// @@ -6,7 +6,7 @@ NAMESPACE ix.framework.core ///> The deferred execution in .NET envornment is not hard-real time nor deterministic. /// /// - CLASS PUBLIC IxRemoteTask EXTENDS IxTask + CLASS PUBLIC AxoRemoteTask EXTENDS AxoTask VAR PUBLIC /// /// Remote system's done signature. diff --git a/src/core/ctrl/src/IxTask/IxTask.st b/src/core/ctrl/src/AxoTask/AxoTask.st similarity index 84% rename from src/core/ctrl/src/IxTask/IxTask.st rename to src/core/ctrl/src/AxoTask/AxoTask.st index 8efdeed3e..a9aebe741 100644 --- a/src/core/ctrl/src/IxTask/IxTask.st +++ b/src/core/ctrl/src/AxoTask/AxoTask.st @@ -1,6 +1,6 @@ -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core - CLASS PUBLIC IxTask EXTENDS IxObject IMPLEMENTS IIxTask, IIxTaskState + CLASS PUBLIC AxoTask EXTENDS AxoObject IMPLEMENTS IAxoTask, IAxoTaskState VAR PUBLIC /// @@ -8,7 +8,7 @@ NAMESPACE ix.framework.core /// {#ix-set:AttributeName = "<#Command state#>"} {#ix-attr:[ReadOnly()]} - Status : eIxTaskState; + Status : eAxoTaskState; /// /// Gets or sets whether this task is disabled for execution. @@ -58,7 +58,7 @@ NAMESPACE ix.framework.core /// /// Gets the actual state of this task. /// - METHOD PUBLIC GetState : eIxTaskState + METHOD PUBLIC GetState : eAxoTaskState THIS.UpdateState(); GetState := Status; END_METHOD @@ -72,7 +72,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC IsReady : BOOL THIS.UpdateState(); - IsReady := Status = eIxTaskState#Ready; + IsReady := Status = eAxoTaskState#Ready; END_METHOD /// @@ -80,7 +80,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC IsDone : BOOL THIS.UpdateState(); - IsDone := Status = eIxTaskState#Done ; + IsDone := Status = eAxoTaskState#Done ; END_METHOD /// @@ -88,7 +88,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC IsBusy : BOOL THIS.UpdateState(); - IsBusy := Status = eIxTaskState#Busy; + IsBusy := Status = eAxoTaskState#Busy; END_METHOD /// @@ -96,7 +96,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC IsAborted : BOOL THIS.UpdateState(); - IsAborted := Status = eIxTaskState#Aborted; + IsAborted := Status = eAxoTaskState#Aborted; END_METHOD /// @@ -104,7 +104,7 @@ NAMESPACE ix.framework.core /// METHOD PUBLIC HasError : BOOL THIS.UpdateState(); - HasError := Status = eIxTaskState#Error; + HasError := Status = eAxoTaskState#Error; END_METHOD METHOD PRIVATE IsNewInvokeCall : BOOL @@ -156,17 +156,17 @@ NAMESPACE ix.framework.core END_METHOD METHOD PRIVATE UpdateState - IF Status <> eIxTaskState#Error AND IsDisabled THEN - Status := eIxTaskState#Disabled; - ELSIF Status = eIxTaskState#Disabled AND NOT IsDisabled THEN - Status := eIxTaskState#Ready; + IF Status <> eAxoTaskState#Error AND IsDisabled THEN + Status := eAxoTaskState#Disabled; + ELSIF Status = eAxoTaskState#Disabled AND NOT IsDisabled THEN + Status := eAxoTaskState#Ready; END_IF; END_METHOD /// /// Invokes this task. /// - METHOD PUBLIC Invoke : IIxTaskState + METHOD PUBLIC Invoke : IAxoTaskState VAR _isNullContext : BOOL; END_VAR; @@ -175,19 +175,19 @@ NAMESPACE ix.framework.core IF _isNullContext THEN - Status := eIxTaskState#Error; + Status := eAxoTaskState#Error; END_IF; THIS.UpdateState(); - IF Status = eIxTaskState#Done AND THIS.IsNewInvokeCall() THEN - Status := eIxTaskState#Ready; + IF Status = eAxoTaskState#Done AND THIS.IsNewInvokeCall() THEN + Status := eAxoTaskState#Ready; END_IF; _openCycleCountInvoke := THIS.GetContext().OpenCycleCount(); // task task should not be Invoked, if the execute method was not called in this or previous PLC cycle - IF Status = eIxTaskState#Ready AND (THIS.IsExecuteCalledInThisPlcCycle() OR THIS.WasExecuteCalledInPreviousPlcCycle()) THEN - Status := eIxTaskState#Kicking; + IF Status = eAxoTaskState#Ready AND (THIS.IsExecuteCalledInThisPlcCycle() OR THIS.WasExecuteCalledInPreviousPlcCycle()) THEN + Status := eAxoTaskState#Kicking; END_IF; Invoke := THIS; @@ -196,8 +196,8 @@ NAMESPACE ix.framework.core /// /// Restores this task. /// - METHOD PUBLIC Restore : IIxTaskState - Status := eIxTaskState#Ready; + METHOD PUBLIC Restore : IAxoTaskState + Status := eAxoTaskState#Ready; ErrorDetails := ''; THIS.UpdateState(); Restore := THIS; @@ -213,8 +213,8 @@ NAMESPACE ix.framework.core Condition : BOOL; END_VAR - IF Condition AND Status = eIxTaskState#Busy THEN - Status := eIxTaskState#Done; + IF Condition AND Status = eAxoTaskState#Busy THEN + Status := eAxoTaskState#Done; THIS.OnDone(); END_IF; END_METHOD @@ -234,23 +234,23 @@ NAMESPACE ix.framework.core // If the Invoke() method was called in more then one PLC cycle back without calling the Execute() method // and the Execute() is subsequently called without calling the Invoke() method in the same PLC cycle, // CommandTask is set back to ready and does not start the execution. - IF Status = eIxTaskState#Kicking AND NOT THIS.IsInvokeCalledInThisPlcCycle() AND NOT THIS.WasInvokeCalledInPreviousPlcCycle() THEN - Status := eIxTaskState#Ready; + IF Status = eAxoTaskState#Kicking AND NOT THIS.IsInvokeCalledInThisPlcCycle() AND NOT THIS.WasInvokeCalledInPreviousPlcCycle() THEN + Status := eAxoTaskState#Ready; END_IF; - IF(Status = eIxTaskState#Kicking) THEN - Status := eIxTaskState#Busy; + IF(Status = eAxoTaskState#Kicking) THEN + Status := eAxoTaskState#Busy; // Don't touch this, it is used for remote execs. StartSignature := THIS.GetContext().OpenCycleCount(); THIS.OnStart(); END_IF; - IF(Status = eIxTaskState#Error) THEN + IF(Status = eAxoTaskState#Error) THEN THIS.WhileError(); END_IF; THIS.UpdateState(); - Execute := Status = eIxTaskState#Busy; + Execute := Status = eAxoTaskState#Busy; END_METHOD /// @@ -263,7 +263,7 @@ NAMESPACE ix.framework.core END_VAR IF(HasErrorState) THEN - Status := eIxTaskState#Error; + Status := eAxoTaskState#Error; THIS.OnError(); THIS.WhileError(); END_IF; @@ -305,8 +305,8 @@ NAMESPACE ix.framework.core /// Aborts the execution of the task if running and sets its state to aborted. /// METHOD PUBLIC Abort - IF THIS.Status = eIxTaskState#Busy THEN - THIS.Status := eIxTaskState#Aborted; + IF THIS.Status = eAxoTaskState#Busy THEN + THIS.Status := eAxoTaskState#Aborted; THIS.OnAbort(); END_IF; END_METHOD @@ -315,8 +315,8 @@ NAMESPACE ix.framework.core /// Resume the execution of the task if aborted and sets its state to busy. /// METHOD PUBLIC Resume - IF THIS.Status = eIxTaskState#Aborted THEN - THIS.Status := eIxTaskState#Busy; + IF THIS.Status = eAxoTaskState#Aborted THEN + THIS.Status := eAxoTaskState#Busy; THIS.OnResume(); END_IF; END_METHOD diff --git a/src/core/ctrl/src/IxTask/eIxTaskState.st b/src/core/ctrl/src/AxoTask/eAxoTaskState.st similarity index 82% rename from src/core/ctrl/src/IxTask/eIxTaskState.st rename to src/core/ctrl/src/AxoTask/eAxoTaskState.st index 665efe2a1..9191028de 100644 --- a/src/core/ctrl/src/IxTask/eIxTaskState.st +++ b/src/core/ctrl/src/AxoTask/eAxoTaskState.st @@ -1,6 +1,6 @@ -NAMESPACE ix.framework.core +NAMESPACE AXOpen.Core TYPE PUBLIC - eIxTaskState : INT + eAxoTaskState : INT ( Disabled :=0, Ready := 1, diff --git a/src/core/ctrl/src/IxContext/IxContextEnvironment.st b/src/core/ctrl/src/IxContext/IxContextEnvironment.st deleted file mode 100644 index 4478cf8c8..000000000 --- a/src/core/ctrl/src/IxContext/IxContextEnvironment.st +++ /dev/null @@ -1,12 +0,0 @@ -USING ix.framework.messaging; - -NAMESPACE ix.framework.core - CLASS PUBLIC IxContextEnvironment IMPLEMENTS IIxContextEnvironment - VAR PRIVATE - _messenger : IxMessengerEnv; - END_VAR - METHOD PUBLIC Messaging : IIxMessengerEnv - Messaging := _messenger; - END_METHOD - END_CLASS -END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/AxoComponent/IAxoComponent.st b/src/core/ctrl/src/abstractions/AxoComponent/IAxoComponent.st new file mode 100644 index 000000000..77a910a0f --- /dev/null +++ b/src/core/ctrl/src/abstractions/AxoComponent/IAxoComponent.st @@ -0,0 +1,4 @@ +NAMESPACE AXOpen.Core + INTERFACE IAxoComponent EXTENDS IAxoObject,IAxoManuallyControllable + END_INTERFACE +END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/IxComponent/IIxManuallyControllable.st b/src/core/ctrl/src/abstractions/AxoComponent/IAxoManuallyControllable.st similarity index 66% rename from src/core/ctrl/src/abstractions/IxComponent/IIxManuallyControllable.st rename to src/core/ctrl/src/abstractions/AxoComponent/IAxoManuallyControllable.st index 014d83bb2..11a64af83 100644 --- a/src/core/ctrl/src/abstractions/IxComponent/IIxManuallyControllable.st +++ b/src/core/ctrl/src/abstractions/AxoComponent/IAxoManuallyControllable.st @@ -1,5 +1,5 @@ -NAMESPACE ix.framework.core - INTERFACE IIxManuallyControllable +NAMESPACE AXOpen.Core + INTERFACE IAxoManuallyControllable METHOD ActivateManualControl END_METHOD METHOD IsManuallyControllable: BOOL END_METHOD END_INTERFACE diff --git a/src/core/ctrl/src/abstractions/AxoContext/IAxoContext.st b/src/core/ctrl/src/abstractions/AxoContext/IAxoContext.st new file mode 100644 index 000000000..91df2b1eb --- /dev/null +++ b/src/core/ctrl/src/abstractions/AxoContext/IAxoContext.st @@ -0,0 +1,12 @@ +USING AXOpen.Rtc; +NAMESPACE AXOpen.Core + INTERFACE IAxoContext + METHOD CreateIdentity : ULINT END_METHOD + METHOD OpenCycleCount : ULINT END_METHOD + METHOD GetRtc : IAxoRtc END_METHOD + METHOD InjectRtc VAR_INPUT Rtc : IAxoRtc; END_VAR END_METHOD + METHOD Environment : IAxoContextEnvironment END_METHOD + // METHOD SetContextEnvironment VAR_INPUT inContextEnvironnment : IAxoContextEnvironment; END_VAR END_METHOD + END_INTERFACE +END_NAMESPACE + diff --git a/src/core/ctrl/src/abstractions/AxoContext/IAxoContextEnvironment.st b/src/core/ctrl/src/abstractions/AxoContext/IAxoContextEnvironment.st new file mode 100644 index 000000000..1f997f887 --- /dev/null +++ b/src/core/ctrl/src/abstractions/AxoContext/IAxoContextEnvironment.st @@ -0,0 +1,7 @@ +USING AXOpen.Messaging; +NAMESPACE AXOpen.Core + INTERFACE IAxoContextEnvironment + METHOD Messaging : IAxoMessengerEnv END_METHOD + END_INTERFACE +END_NAMESPACE + diff --git a/src/core/ctrl/src/abstractions/AxoCoordination/AxoCoordinatorStates.st b/src/core/ctrl/src/abstractions/AxoCoordination/AxoCoordinatorStates.st new file mode 100644 index 000000000..9732eacda --- /dev/null +++ b/src/core/ctrl/src/abstractions/AxoCoordination/AxoCoordinatorStates.st @@ -0,0 +1,5 @@ +NAMESPACE AXOpen.Core + TYPE PUBLIC + AxoCoordinatorStates : INT (Idle := 0, Configuring := 1, Running := 2) := Idle; + END_TYPE +END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/AxoCoordination/AxoSequencer/IAxoSequencer.st b/src/core/ctrl/src/abstractions/AxoCoordination/AxoSequencer/IAxoSequencer.st new file mode 100644 index 000000000..e44502815 --- /dev/null +++ b/src/core/ctrl/src/abstractions/AxoCoordination/AxoSequencer/IAxoSequencer.st @@ -0,0 +1,4 @@ +NAMESPACE AXOpen.Core + INTERFACE INTERNAL IAxoSequencer EXTENDS IAxoCoordinator + END_INTERFACE +END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/IxCoordination/IxStep/IIxStep.st b/src/core/ctrl/src/abstractions/AxoCoordination/AxoStep/IAxoStep.st similarity index 69% rename from src/core/ctrl/src/abstractions/IxCoordination/IxStep/IIxStep.st rename to src/core/ctrl/src/abstractions/AxoCoordination/AxoStep/IAxoStep.st index 0c6e60c92..460cc966d 100644 --- a/src/core/ctrl/src/abstractions/IxCoordination/IxStep/IIxStep.st +++ b/src/core/ctrl/src/abstractions/AxoCoordination/AxoStep/IAxoStep.st @@ -1,7 +1,7 @@ -NAMESPACE ix.framework.core - INTERFACE IIxStep EXTENDS IIxTask +NAMESPACE AXOpen.Core + INTERFACE IAxoStep EXTENDS IAxoTask METHOD GetStepOrder : ULINT END_METHOD - METHOD SetStepOrder VAR_INPUT coord : IIxCoordinator; StepOrder : ULINT; END_VAR END_METHOD + METHOD SetStepOrder VAR_INPUT coord : IAxoCoordinator; StepOrder : ULINT; END_VAR END_METHOD METHOD IsCalledJustOnceInThisPlcCycle : BOOL END_METHOD METHOD SetIsActive VAR_INPUT Active : BOOL; END_VAR END_METHOD METHOD GetIsActive : BOOL END_METHOD diff --git a/src/core/ctrl/src/abstractions/AxoCoordination/IAxoCoordinator.st b/src/core/ctrl/src/abstractions/AxoCoordination/IAxoCoordinator.st new file mode 100644 index 000000000..025600b40 --- /dev/null +++ b/src/core/ctrl/src/abstractions/AxoCoordination/IAxoCoordinator.st @@ -0,0 +1,6 @@ +NAMESPACE AXOpen.Core + INTERFACE IAxoCoordinator + METHOD GetCoordinatorState : AxoCoordinatorStates END_METHOD + END_INTERFACE + +END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/AxoObject/IAxoObject.st b/src/core/ctrl/src/abstractions/AxoObject/IAxoObject.st new file mode 100644 index 000000000..6acebfa14 --- /dev/null +++ b/src/core/ctrl/src/abstractions/AxoObject/IAxoObject.st @@ -0,0 +1,7 @@ +NAMESPACE AXOpen.Core + INTERFACE IAxoObject + METHOD GetIdentity : ULINT END_METHOD + METHOD GetContext : IAxoContext END_METHOD + END_INTERFACE +END_NAMESPACE + diff --git a/src/core/ctrl/src/abstractions/IxTask/IIxTask.st b/src/core/ctrl/src/abstractions/AxoTask/IAxoTask.st similarity index 74% rename from src/core/ctrl/src/abstractions/IxTask/IIxTask.st rename to src/core/ctrl/src/abstractions/AxoTask/IAxoTask.st index 555bb1953..5a318efac 100644 --- a/src/core/ctrl/src/abstractions/IxTask/IIxTask.st +++ b/src/core/ctrl/src/abstractions/AxoTask/IAxoTask.st @@ -1,8 +1,8 @@ -NAMESPACE ix.framework.core - INTERFACE IIxTask EXTENDS IIxObject,IIxTaskInt +NAMESPACE AXOpen.Core + INTERFACE IAxoTask EXTENDS IAxoObject,IAxoTaskInt METHOD Execute : BOOL END_METHOD - METHOD Invoke : IIxTaskState END_METHOD - METHOD Restore : IIxTaskState END_METHOD + METHOD Invoke : IAxoTaskState END_METHOD + METHOD Restore : IAxoTaskState END_METHOD METHOD Abort END_METHOD METHOD Resume END_METHOD METHOD DoneWhen VAR_INPUT Condition : BOOL; END_VAR END_METHOD @@ -12,7 +12,7 @@ NAMESPACE ix.framework.core METHOD IsBusy : BOOL END_METHOD METHOD HasError : BOOL END_METHOD END_INTERFACE - INTERFACE INTERNAL IIxTaskInt + INTERFACE INTERNAL IAxoTaskInt METHOD SetIsDisabled VAR_INPUT Disabled : BOOL; END_VAR END_METHOD METHOD GetIsDisabled : BOOL END_METHOD END_INTERFACE diff --git a/src/core/ctrl/src/abstractions/IxTask/IIxTaskState.st b/src/core/ctrl/src/abstractions/AxoTask/IAxoTaskState.st similarity index 82% rename from src/core/ctrl/src/abstractions/IxTask/IIxTaskState.st rename to src/core/ctrl/src/abstractions/AxoTask/IAxoTaskState.st index a04242d1b..8e7330b47 100644 --- a/src/core/ctrl/src/abstractions/IxTask/IIxTaskState.st +++ b/src/core/ctrl/src/abstractions/AxoTask/IAxoTaskState.st @@ -1,5 +1,5 @@ -NAMESPACE ix.framework.core - INTERFACE IIxTaskState +NAMESPACE AXOpen.Core + INTERFACE IAxoTaskState METHOD IsDone : BOOL END_METHOD METHOD IsBusy : BOOL END_METHOD METHOD IsAborted : BOOL END_METHOD diff --git a/src/core/ctrl/src/abstractions/IxComponent/IIxComponent.st b/src/core/ctrl/src/abstractions/IxComponent/IIxComponent.st deleted file mode 100644 index 6596a3bc0..000000000 --- a/src/core/ctrl/src/abstractions/IxComponent/IIxComponent.st +++ /dev/null @@ -1,4 +0,0 @@ -NAMESPACE ix.framework.core - INTERFACE IIxComponent EXTENDS IIxObject,IIxManuallyControllable - END_INTERFACE -END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/IxContext/IIxContext.st b/src/core/ctrl/src/abstractions/IxContext/IIxContext.st deleted file mode 100644 index ac52550c6..000000000 --- a/src/core/ctrl/src/abstractions/IxContext/IIxContext.st +++ /dev/null @@ -1,12 +0,0 @@ -USING ix.framework.rtc; -NAMESPACE ix.framework.core - INTERFACE IIxContext - METHOD CreateIdentity : ULINT END_METHOD - METHOD OpenCycleCount : ULINT END_METHOD - METHOD GetRtc : IRtc END_METHOD - METHOD InjectRtc VAR_INPUT Rtc : IRtc; END_VAR END_METHOD - METHOD Environment : IIxContextEnvironment END_METHOD - // METHOD SetContextEnvironment VAR_INPUT inContextEnvironnment : IIxContextEnvironment; END_VAR END_METHOD - END_INTERFACE -END_NAMESPACE - diff --git a/src/core/ctrl/src/abstractions/IxContext/IIxContextEnvironment.st b/src/core/ctrl/src/abstractions/IxContext/IIxContextEnvironment.st deleted file mode 100644 index ffb3bd359..000000000 --- a/src/core/ctrl/src/abstractions/IxContext/IIxContextEnvironment.st +++ /dev/null @@ -1,7 +0,0 @@ -USING ix.framework.messaging; -NAMESPACE ix.framework.core - INTERFACE IIxContextEnvironment - METHOD Messaging : IIxMessengerEnv END_METHOD - END_INTERFACE -END_NAMESPACE - diff --git a/src/core/ctrl/src/abstractions/IxCoordination/IIxCoordinator.st b/src/core/ctrl/src/abstractions/IxCoordination/IIxCoordinator.st deleted file mode 100644 index 7d0a528a1..000000000 --- a/src/core/ctrl/src/abstractions/IxCoordination/IIxCoordinator.st +++ /dev/null @@ -1,6 +0,0 @@ -NAMESPACE ix.framework.core - INTERFACE IIxCoordinator - METHOD GetCoordinatorState : CoordinatorStates END_METHOD - END_INTERFACE - -END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/IxCoordination/IxCoordinatorStates.st b/src/core/ctrl/src/abstractions/IxCoordination/IxCoordinatorStates.st deleted file mode 100644 index 8a9992f86..000000000 --- a/src/core/ctrl/src/abstractions/IxCoordination/IxCoordinatorStates.st +++ /dev/null @@ -1,5 +0,0 @@ -NAMESPACE ix.framework.core - TYPE PUBLIC - CoordinatorStates : INT (Idle := 0, Configuring := 1, Running := 2) := Idle; - END_TYPE -END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/IxCoordination/IxSequencer/IIxSequencer.st b/src/core/ctrl/src/abstractions/IxCoordination/IxSequencer/IIxSequencer.st deleted file mode 100644 index b9f1a8d45..000000000 --- a/src/core/ctrl/src/abstractions/IxCoordination/IxSequencer/IIxSequencer.st +++ /dev/null @@ -1,4 +0,0 @@ -NAMESPACE ix.framework.core - INTERFACE INTERNAL IIxSequencer EXTENDS IIxCoordinator - END_INTERFACE -END_NAMESPACE diff --git a/src/core/ctrl/src/abstractions/IxObject/IIxObject.st b/src/core/ctrl/src/abstractions/IxObject/IIxObject.st deleted file mode 100644 index 5aacdfaeb..000000000 --- a/src/core/ctrl/src/abstractions/IxObject/IIxObject.st +++ /dev/null @@ -1,7 +0,0 @@ -NAMESPACE ix.framework.core - INTERFACE IIxObject - METHOD GetIdentity : ULINT END_METHOD - METHOD GetContext : IIxContext END_METHOD - END_INTERFACE -END_NAMESPACE - diff --git a/src/core/ctrl/test/IxContext/IxContextTests.st b/src/core/ctrl/test/AxoContext/AxoContextTests.st similarity index 88% rename from src/core/ctrl/test/IxContext/IxContextTests.st rename to src/core/ctrl/test/AxoContext/AxoContextTests.st index d5d4acc4f..cda4a082a 100644 --- a/src/core/ctrl/test/IxContext/IxContextTests.st +++ b/src/core/ctrl/test/AxoContext/AxoContextTests.st @@ -1,15 +1,16 @@ USING AxUnit; +USING AXOpen.Core; -NAMESPACE ix.core.IxContext_Tests +NAMESPACE AXOpen.Core.AxoContext_Tests - CLASS TestContext EXTENDS ix.framework.core.IxContext + CLASS TestContext EXTENDS AxoContext METHOD PROTECTED OVERRIDE Main ; END_METHOD END_CLASS {TestFixture} - CLASS IxContextUnitTests + CLASS AxoContextUnitTests VAR PROTECTED _context : TestContext; END_VAR diff --git a/src/core/ctrl/test/IxCoordination/IxSequencerTests.st b/src/core/ctrl/test/AxoCoordination/AxoSequencerTests.st similarity index 87% rename from src/core/ctrl/test/IxCoordination/IxSequencerTests.st rename to src/core/ctrl/test/AxoCoordination/AxoSequencerTests.st index 938dd0b0e..9dd02ae67 100644 --- a/src/core/ctrl/test/IxCoordination/IxSequencerTests.st +++ b/src/core/ctrl/test/AxoCoordination/AxoSequencerTests.st @@ -1,10 +1,10 @@ USING AxUnit; -USING ix.framework.core; -USING ix.framework.rtc; +USING AXOpen.Core; +USING AXOpen.Rtc; -NAMESPACE ix.core.IxSequencer_Tests +NAMESPACE AXOpen.Core.AxoSequencer_Tests - CLASS TestContext IMPLEMENTS ix.framework.core.IIxContext + CLASS TestContext IMPLEMENTS IAxoContext VAR PROTECTED _openCounter : ULINT; _closeCounter : ULINT; @@ -31,17 +31,17 @@ NAMESPACE ix.core.IxSequencer_Tests CreateIdentity := _identityCounter; END_METHOD - METHOD PUBLIC GetRtc : IRtc ; END_METHOD + METHOD PUBLIC GetRtc : IAxoRtc ; END_METHOD - METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IRtc; END_VAR ; END_METHOD + METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IAxoRtc; END_VAR ; END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment ; END_METHOD END_CLASS - CLASS MySequencer EXTENDS IxSequencer + CLASS MySequencer EXTENDS AxoSequencer VAR PRIVATE OnBeforeSequenceStartCounter : ULINT; OnCompleteSequenceCounter : ULINT; @@ -69,47 +69,47 @@ NAMESPACE ix.core.IxSequencer_Tests VAR PROTECTED _context : TestContext; _sequencer : MySequencer; - _step_1 : IxStep; - _step_2 : IxStep; - _step_3 : IxStep; + _step_1 : AxoStep; + _step_2 : AxoStep; + _step_3 : AxoStep; _orderCounter : ULINT; - _stepState : eIxTaskState; + _stepState : eAxoTaskState; _counter : ULINT; END_VAR METHOD Equal : BOOL VAR_INPUT - expected: eIxTaskState; - actual: eIxTaskState; + expected: eAxoTaskState; + actual: eAxoTaskState; END_VAR Equal := expected = actual; END_METHOD METHOD Equal : BOOL VAR_INPUT - expected: CoordinatorStates; - actual: CoordinatorStates; + expected: AxoCoordinatorStates; + actual: AxoCoordinatorStates; END_VAR Equal := expected = actual; END_METHOD METHOD Equal : BOOL VAR_INPUT - expected: eIxSteppingMode; - actual: eIxSteppingMode; + expected: eAxoSteppingMode; + actual: eAxoSteppingMode; END_VAR Equal := expected = actual; END_METHOD METHOD Equal : BOOL VAR_INPUT - expected: eIxSequenceMode; - actual: eIxSequenceMode; + expected: eAxoSequenceMode; + actual: eAxoSequenceMode; END_VAR Equal := expected = actual; END_METHOD - METHOD PUBLIC GetSequencerState : CoordinatorStates + METHOD PUBLIC GetSequencerState : AxoCoordinatorStates GetSequencerState := _sequencer.GetCoordinatorState(); END_METHOD @@ -167,31 +167,31 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC should_be_in_idle - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); END_METHOD {Test} METHOD PUBLIC should_be_in_idle_after_initialization THIS.InitializeSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); END_METHOD {Test} METHOD PUBLIC Open_when_idle_should_transit_to_configuring THIS.InvokeSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); _sequencer.Open(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); END_METHOD {Test} METHOD PUBLIC Open_when_configuring_should_transit_to_running THIS.InvokeSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); _sequencer.Open(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); _sequencer.Open(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Running , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Running , _sequencer.GetCoordinatorState())); END_METHOD {Test} @@ -212,7 +212,7 @@ NAMESPACE ix.core.IxSequencer_Tests THIS.InvokeSequence(); _sequencer.Open(); // Configuring steps no step should execute - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); Assert.Equal(FALSE,_step_1.Execute(_sequencer)); Assert.Equal(FALSE,_step_2.Execute(_sequencer)); Assert.Equal(FALSE,_step_3.Execute(_sequencer)); @@ -339,7 +339,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC RequestStep_should_not_affect_the_sequence_when_the_coordinator_is_in_idle - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); _sequencer.RequestStep(_step_3); _sequencer.Open(); // Configuring steps no step should execute @@ -351,13 +351,13 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC RequestStep_should_not_affect_the_sequence_when_the_coordinator_is_in_configuring THIS.InvokeSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); _sequencer.Open(); // Configuring steps no step should execute Assert.Equal(FALSE, _step_1.Execute(_sequencer)); Assert.Equal(FALSE, _step_2.Execute(_sequencer)); Assert.Equal(FALSE, _step_3.Execute(_sequencer)); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); _sequencer.RequestStep(_step_3); _context.Close(); @@ -552,13 +552,13 @@ NAMESPACE ix.core.IxSequencer_Tests StepOrderLastValue : ULINT; END_VAR Assert.Equal(ULINT#0, _orderCounter); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); //First sequence run, no step is executed _context.Open(); THIS.MAIN_123(); _context.Close(); Assert.Equal(ULINT#0, _orderCounter); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); StepOrderLastValue := _orderCounter; //Second sequence run, steps are going already to be executed. //Steps are called in the order: step_1, step_2, step_3. @@ -568,7 +568,7 @@ NAMESPACE ix.core.IxSequencer_Tests THIS.MAIN_123(); _context.Close(); Assert.Equal(ULINT#6, _orderCounter - StepOrderLastValue); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); StepOrderLastValue := _orderCounter; //First sequence run after CompleteSequence() call on running sequence //No steps are going to be executed, as the orders of the steps need to be assign again @@ -576,7 +576,7 @@ NAMESPACE ix.core.IxSequencer_Tests THIS.MAIN_123(); _context.Close(); Assert.Equal(ULINT#0, _orderCounter - StepOrderLastValue); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); StepOrderLastValue := _orderCounter; //Steps are called in the order: step_1,step_2, step_2. //Step body should be executed only for step_1 and for first call of the step_2 @@ -585,13 +585,13 @@ NAMESPACE ix.core.IxSequencer_Tests THIS.MAIN_122(); _context.Close(); Assert.Equal(ULINT#3, _orderCounter - StepOrderLastValue); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); END_METHOD {Test} METHOD PUBLIC step_called_more_then_once_inside_the_configuring_sequence_should_set_the_sequence_to_idle //TODO error state Assert.Equal(ULINT#0, _orderCounter); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); //First sequence run, no step is executed _context.Open(); THIS.MAIN_12x(); @@ -601,10 +601,10 @@ NAMESPACE ix.core.IxSequencer_Tests Assert.Equal(ULINT#1, _step_1.Order); Assert.Equal(ULINT#2, _step_2.Order); Assert.Equal(ULINT#0, _step_3.Order); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); _step_2.Execute(_sequencer); _context.Close(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); Assert.Equal(FALSE, _step_1.IsActive); Assert.Equal(FALSE, _step_2.IsActive); Assert.Equal(FALSE, _step_3.IsActive); @@ -619,13 +619,13 @@ NAMESPACE ix.core.IxSequencer_Tests StepOrderLastValue : ULINT; END_VAR Assert.Equal(ULINT#0, _orderCounter); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); //First sequence run, no step is executed _context.Open(); THIS.MAIN_123(); _context.Close(); Assert.Equal(ULINT#0, _orderCounter); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); StepOrderLastValue := _orderCounter; //Second sequence run, steps are going already to be executed. //Steps are called in the order: step_1, step_2. @@ -634,7 +634,7 @@ NAMESPACE ix.core.IxSequencer_Tests THIS.MAIN_12x(); _context.Close(); Assert.Equal(ULINT#3, _orderCounter - StepOrderLastValue); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Running , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Running , _sequencer.GetCoordinatorState())); StepOrderLastValue := _orderCounter; // Assert.Equal(TRUE,_sequencer.IsInOrderOfExecution(_step_3)); Assert.Equal(_sequencer.CurrentOrder,_step_3.Order); @@ -645,7 +645,7 @@ NAMESPACE ix.core.IxSequencer_Tests THIS.MAIN_123(); _context.Close(); Assert.Equal(ULINT#0, _orderCounter - StepOrderLastValue); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); END_METHOD {Test} @@ -675,7 +675,7 @@ NAMESPACE ix.core.IxSequencer_Tests METHOD PUBLIC CompleteSequence_should_set_the_coordinator_state_to_Idle THIS.ExecuteSequence(TRUE,FALSE); _sequencer.CompleteSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); END_METHOD {Test} @@ -708,13 +708,13 @@ NAMESPACE ix.core.IxSequencer_Tests METHOD PUBLIC currently_executed_step_should_indicate_its_state_as_busy THIS.PrepareSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring, _sequencer.GetCoordinatorState())); - Assert.Equal(TRUE, THIS.Equal(eIxTaskState#Disabled, _step_1.GetState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring, _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(eAxoTaskState#Disabled, _step_1.GetState())); _context.Open(); _sequencer.Open(); Assert.Equal(TRUE , _step_1.Execute(_sequencer)); - Assert.Equal(TRUE , THIS.Equal(eIxTaskState#Busy, _step_1.GetState())); + Assert.Equal(TRUE , THIS.Equal(eAxoTaskState#Busy, _step_1.GetState())); Assert.Equal(TRUE , _step_1.IsBusy()); Assert.Equal(FALSE, _step_1.IsDone()); Assert.Equal(FALSE, _step_1.HasError()); @@ -723,7 +723,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC when_sequence_is_configuring_all_steps_should_be_disabled THIS.InvokeSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); _sequencer.Open(); // Configuring steps no step should execute Assert.Equal(FALSE, _step_1.Execute(_sequencer)); @@ -735,11 +735,11 @@ NAMESPACE ix.core.IxSequencer_Tests Assert.Equal(FALSE, _step_2.IsDone()); Assert.Equal(FALSE, _step_3.IsBusy()); Assert.Equal(FALSE, _step_3.IsDone()); - Assert.Equal(TRUE , _step_1.GetState() = eIxTaskState#Disabled); - Assert.Equal(TRUE , _step_2.GetState() = eIxTaskState#Disabled); - Assert.Equal(TRUE , _step_3.GetState() = eIxTaskState#Disabled); + Assert.Equal(TRUE , _step_1.GetState() = eAxoTaskState#Disabled); + Assert.Equal(TRUE , _step_2.GetState() = eAxoTaskState#Disabled); + Assert.Equal(TRUE , _step_3.GetState() = eAxoTaskState#Disabled); _context.Close(); - Assert.Equal(TRUE , THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE , THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); END_METHOD {Test} @@ -750,7 +750,7 @@ NAMESPACE ix.core.IxSequencer_Tests _sequencer.Open(); Assert.Equal(TRUE , _step_1.Execute(_sequencer)); _sequencer.MoveNext(); - Assert.Equal(TRUE , THIS.Equal(eIxTaskState#Done, _step_1.GetState())); + Assert.Equal(TRUE , THIS.Equal(eAxoTaskState#Done, _step_1.GetState())); Assert.Equal(FALSE, _step_1.IsBusy()); Assert.Equal(TRUE , _step_1.IsDone()); Assert.Equal(FALSE, _step_1.HasError()); @@ -774,7 +774,7 @@ NAMESPACE ix.core.IxSequencer_Tests Assert.Equal(FALSE, _step_3.IsBusy()); Assert.Equal(FALSE, _step_3.IsDone()); _context.Close(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Running , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Running , _sequencer.GetCoordinatorState())); _context.Open(); _sequencer.Open(); @@ -791,7 +791,7 @@ NAMESPACE ix.core.IxSequencer_Tests Assert.Equal(TRUE , _step_3.IsBusy()); Assert.Equal(FALSE, _step_3.IsDone()); _context.Close(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Running , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Running , _sequencer.GetCoordinatorState())); _context.Open(); _sequencer.Open(); @@ -825,11 +825,11 @@ NAMESPACE ix.core.IxSequencer_Tests Assert.Equal(FALSE, _step_2.IsDone()); Assert.Equal(FALSE, _step_3.IsBusy()); Assert.Equal(FALSE, _step_3.IsDone()); - Assert.Equal(TRUE , _step_1.GetState() = eIxTaskState#Disabled); - Assert.Equal(TRUE , _step_2.GetState() = eIxTaskState#Disabled); - Assert.Equal(TRUE , _step_3.GetState() = eIxTaskState#Disabled); + Assert.Equal(TRUE , _step_1.GetState() = eAxoTaskState#Disabled); + Assert.Equal(TRUE , _step_2.GetState() = eAxoTaskState#Disabled); + Assert.Equal(TRUE , _step_3.GetState() = eAxoTaskState#Disabled); _context.Close(); - Assert.Equal(TRUE , THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE , THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); END_METHOD {Test} @@ -865,30 +865,30 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC should_return_the_continous_stepping_mode - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#Continous)); + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#Continous)); END_METHOD {Test} METHOD PUBLIC should_return_the_step_by_step_stepping_mode - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#StepByStep)); + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#StepByStep)); END_METHOD {Test} METHOD PUBLIC should_return_the_cyclic_mode - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SequenceMode, eIxSequenceMode#Cyclic)); + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SequenceMode, eAxoSequenceMode#Cyclic)); END_METHOD {Test} METHOD PUBLIC should_return_the_runonce_mode - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SequenceMode, eIxSequenceMode#RunOnce)); + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SequenceMode, eAxoSequenceMode#RunOnce)); END_METHOD {Test} METHOD PUBLIC RunOnce_mode_CompleteSequence_should_set_currently_executed_step_to_Done THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; Assert.Equal(FALSE, _step_3.IsDone()); _sequencer.CompleteSequence(); Assert.Equal(TRUE, _step_3.IsDone()); @@ -897,7 +897,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC RunOnce_mode_CompleteSequence_should_reset_the_Busy_state_of_the_currently_executed_step THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; Assert.Equal(TRUE, _step_3.IsBusy()); _sequencer.CompleteSequence(); Assert.Equal(FALSE, _step_3.IsBusy()); @@ -906,7 +906,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC RunOnce_mode_CompleteSequence_should_set_the_Current_Order_to_1 THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; _sequencer.CompleteSequence(); Assert.Equal(ULINT#1, _sequencer.CurrentOrder); END_METHOD @@ -914,15 +914,15 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC RunOnce_mode_CompleteSequence_should_set_the_coordinator_state_to_Idle THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; _sequencer.CompleteSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); END_METHOD {Test} METHOD PUBLIC RunOnce_mode_CompleteSequence_should_set_the_CurrentOrder_to_1 THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; _sequencer.CompleteSequence(); _context.Close(); @@ -932,7 +932,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC RunOnce_mode_CompleteSequence_should_stops_the_execution_of_the_active_step_in_the_next_PLC_cycles THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; _sequencer.CompleteSequence(); _context.Close(); @@ -954,7 +954,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC RunOnce_mode_CompleteSequence_coordinator_state_should_stay_in_Idle_in_the_next_PLC_cycles THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; _sequencer.CompleteSequence(); _context.Close(); @@ -963,7 +963,7 @@ NAMESPACE ix.core.IxSequencer_Tests _step_1.Execute(_sequencer); _step_2.Execute(_sequencer); _step_3.Execute(_sequencer); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); _context.Close(); _context.Open(); @@ -971,7 +971,7 @@ NAMESPACE ix.core.IxSequencer_Tests _step_1.Execute(_sequencer); _step_2.Execute(_sequencer); _step_3.Execute(_sequencer); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Idle , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Idle , _sequencer.GetCoordinatorState())); _context.Close(); END_METHOD @@ -991,10 +991,10 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC all_stepping_commands_should_be_disabled_when_Sequencer_is_not_running_mode - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#StepByStep)); + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#StepByStep)); THIS.PrepareSequence(); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); Assert.Equal(TRUE,_sequencer.StepForwardCommand.IsDisabled); Assert.Equal(TRUE,_sequencer.StepIn.IsDisabled); Assert.Equal(TRUE,_sequencer.StepBackwardCommand.IsDisabled); @@ -1002,30 +1002,30 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC StepForward_and_StepIn_commands_should_not_be_disabled_when_Sequencer_is_running_mode - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#StepByStep)); + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#StepByStep)); THIS.ExecuteSequence(TRUE,TRUE); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Running , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Running , _sequencer.GetCoordinatorState())); Assert.Equal(FALSE,_sequencer.StepForwardCommand.IsDisabled); Assert.Equal(FALSE,_sequencer.StepIn.IsDisabled); END_METHOD {Test} METHOD PUBLIC StepBackward_command_should_not_be_disabled_when_Sequencer_is_running_mode_and_CurrentOrder_is_greather_then_one - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#StepByStep)); + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#StepByStep)); THIS.ExecuteSequence(TRUE,TRUE); _sequencer.RequestStep(_step_2); THIS.ExecuteSequence(TRUE,TRUE); - Assert.Equal(TRUE, THIS.Equal(CoordinatorStates#Running , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE, THIS.Equal(AxoCoordinatorStates#Running , _sequencer.GetCoordinatorState())); Assert.Equal(FALSE,_sequencer.StepBackwardCommand.IsDisabled); END_METHOD {Test} METHOD PUBLIC StepInCommand_should_invoke_the_current_step // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#StepByStep)); + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#StepByStep)); THIS.ExecuteSequence(FALSE,FALSE); Assert.Equal(ULINT#1, _sequencer.CurrentOrder); Assert.Equal(TRUE,_step_1.IsActive); @@ -1051,8 +1051,8 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC StepInCommand_should_invoke_the_current_step_if_Current_step_is_Done_StepIn_should_be_also_Done // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#StepByStep)); + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#StepByStep)); THIS.ExecuteSequence(TRUE,FALSE); Assert.Equal(ULINT#1, _sequencer.CurrentOrder); Assert.Equal(TRUE,_step_1.IsActive); @@ -1091,8 +1091,8 @@ NAMESPACE ix.core.IxSequencer_Tests Assert.Equal(FALSE,_step_2.IsDone()); // Act - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#StepByStep)); + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#StepByStep)); THIS.ExecuteSequence(TRUE,FALSE); // Assert @@ -1113,7 +1113,7 @@ NAMESPACE ix.core.IxSequencer_Tests _previousOrder : ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.StepIn.Invoke(); THIS.ExecuteSequence(FALSE,FALSE); @@ -1169,7 +1169,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC StepForward_should_restore_the_currently_executing_step // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.StepIn.Invoke(); THIS.ExecuteSequence(FALSE,FALSE); @@ -1198,7 +1198,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC StepForward_should_prepare_following_step_to_be_ready_to_execute // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.StepIn.Invoke(); THIS.ExecuteSequence(FALSE,FALSE); @@ -1226,7 +1226,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC StepForward_command_should_be_in_done_state_after_succesfull_execution // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.StepIn.Invoke(); THIS.ExecuteSequence(FALSE,FALSE); @@ -1256,7 +1256,7 @@ NAMESPACE ix.core.IxSequencer_Tests _previousOrder : ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.StepIn.Invoke(); THIS.ExecuteSequence(FALSE,FALSE); @@ -1281,7 +1281,7 @@ NAMESPACE ix.core.IxSequencer_Tests _previousOrder : ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.RequestStep(_step_3); _sequencer.StepIn.Invoke(); @@ -1303,7 +1303,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC StepForward_command_should_be_disabled_when_CurrentOrder_is_equal_to_last_step_order - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.RequestStep(_step_3); THIS.ExecuteSequence(FALSE,FALSE); @@ -1321,7 +1321,7 @@ NAMESPACE ix.core.IxSequencer_Tests _previousOrder : ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.RequestStep(_step_3); _sequencer.StepIn.Invoke(); @@ -1381,7 +1381,7 @@ NAMESPACE ix.core.IxSequencer_Tests _previousOrder : ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.RequestStep(_step_3); _sequencer.StepIn.Invoke(); @@ -1413,7 +1413,7 @@ NAMESPACE ix.core.IxSequencer_Tests _previousOrder : ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.RequestStep(_step_3); _sequencer.StepIn.Invoke(); @@ -1445,7 +1445,7 @@ NAMESPACE ix.core.IxSequencer_Tests _previousOrder : ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.RequestStep(_step_3); _sequencer.StepIn.Invoke(); @@ -1475,7 +1475,7 @@ NAMESPACE ix.core.IxSequencer_Tests _previousOrder : ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); _sequencer.RequestStep(_step_3); _sequencer.StepIn.Invoke(); @@ -1497,7 +1497,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC StepBackward_command_should_be_disabled_when_CurrentOrder_is_equal_to_last_step_order - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); Assert.Equal(ULINT#1,_sequencer.CurrentOrder); @@ -1524,7 +1524,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnBeforeSequenceStart_should_be_triggered_when_sequence_starts_even_in_step_by_step_mode - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS._counter := _sequencer.GetOnBeforeSequenceStartCounter(); THIS.ExecuteSequence(FALSE,FALSE); Assert.Equal(THIS._counter + ULINT#1,_sequencer.GetOnBeforeSequenceStartCounter()); @@ -1532,7 +1532,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnBeforeSequenceStart_should_not_be_triggered_when_sequence_has_been_already_started_even_in_step_by_step_mode - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); THIS._counter := _sequencer.GetOnBeforeSequenceStartCounter(); THIS.ExecuteSequence(FALSE,FALSE); @@ -1541,7 +1541,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnBeforeSequenceStart_should_be_triggered_when_sequence_starts_even_in_run_once_mode - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; THIS._counter := _sequencer.GetOnBeforeSequenceStartCounter(); THIS.ExecuteSequence(FALSE,FALSE); Assert.Equal(THIS._counter + ULINT#1,_sequencer.GetOnBeforeSequenceStartCounter()); @@ -1549,7 +1549,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnBeforeSequenceStart_should_not_be_triggered_when_sequence_has_been_already_started_even_in_run_once_mode - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; THIS.ExecuteSequence(FALSE,FALSE); THIS._counter := _sequencer.GetOnBeforeSequenceStartCounter(); THIS.ExecuteSequence(FALSE,FALSE); @@ -1558,8 +1558,8 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnBeforeSequenceStart_should_be_triggered_when_sequence_starts_even_in_run_once_mode_and_step_by_step_mode - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS._counter := _sequencer.GetOnBeforeSequenceStartCounter(); THIS.ExecuteSequence(FALSE,FALSE); Assert.Equal(THIS._counter + ULINT#1,_sequencer.GetOnBeforeSequenceStartCounter()); @@ -1567,8 +1567,8 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnBeforeSequenceStart_should_not_be_triggered_when_sequence_has_been_already_started_even_in_run_once_mode_and_step_by_step_mode - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS.ExecuteSequence(FALSE,FALSE); THIS._counter := _sequencer.GetOnBeforeSequenceStartCounter(); THIS.ExecuteSequence(FALSE,FALSE); @@ -1595,7 +1595,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnCompleteSequence_should_be_triggered_when_CompleteSequence_is_called_even_in_step_by_step_mode THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS._counter := _sequencer.GetOnCompleteSequenceCounter(); _sequencer.CompleteSequence(); Assert.Equal(THIS._counter + ULINT#1,_sequencer.GetOnCompleteSequenceCounter()); @@ -1604,7 +1604,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnCompleteSequence_should_not_be_triggered_when_CompleteSequence_was_already_called_even_in_step_by_step_mode THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; _sequencer.CompleteSequence(); THIS._counter := _sequencer.GetOnCompleteSequenceCounter(); _sequencer.CompleteSequence(); @@ -1614,7 +1614,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnCompleteSequence_should_be_triggered_when_CompleteSequence_is_called_even_in_run_once_mode THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; THIS._counter := _sequencer.GetOnCompleteSequenceCounter(); _sequencer.CompleteSequence(); Assert.Equal(THIS._counter + ULINT#1,_sequencer.GetOnCompleteSequenceCounter()); @@ -1623,7 +1623,7 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnCompleteSequence_should_not_be_triggered_when_CompleteSequence_was_already_called_even_in_run_once_mode THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; _sequencer.CompleteSequence(); THIS._counter := _sequencer.GetOnCompleteSequenceCounter(); _sequencer.CompleteSequence(); @@ -1633,8 +1633,8 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnCompleteSequence_should_be_triggered_when_CompleteSequence_is_called_even_in_run_once_mode_and_step_by_step_mode THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; THIS._counter := _sequencer.GetOnCompleteSequenceCounter(); _sequencer.CompleteSequence(); Assert.Equal(THIS._counter + ULINT#1,_sequencer.GetOnCompleteSequenceCounter()); @@ -1643,8 +1643,8 @@ NAMESPACE ix.core.IxSequencer_Tests {Test} METHOD PUBLIC OnCompleteSequence_should_not_be_triggered_when_CompleteSequence_was_already_called_even_in_run_once_mode_and_step_by_step_mode THIS.ExecuteSequence(TRUE,FALSE); - _sequencer.SequenceMode := eIxSequenceMode#RunOnce; - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; + _sequencer.SequenceMode := eAxoSequenceMode#RunOnce; + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; _sequencer.CompleteSequence(); THIS._counter := _sequencer.GetOnCompleteSequenceCounter(); _sequencer.CompleteSequence(); @@ -1657,8 +1657,8 @@ NAMESPACE ix.core.IxSequencer_Tests count :ULINT; END_VAR // Arrange - _sequencer.SteppingMode := eIxSteppingMode#StepByStep; - Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eIxSteppingMode#StepByStep)); + _sequencer.SteppingMode := eAxoSteppingMode#StepByStep; + Assert.Equal(TRUE ,THIS.Equal(_sequencer.SteppingMode, eAxoSteppingMode#StepByStep)); THIS.ExecuteSequence(FALSE,FALSE); _sequencer.StepIn.Invoke(); diff --git a/src/core/ctrl/test/IxCoordination/IxStepTests.st b/src/core/ctrl/test/AxoCoordination/AxoStepTests.st similarity index 82% rename from src/core/ctrl/test/IxCoordination/IxStepTests.st rename to src/core/ctrl/test/AxoCoordination/AxoStepTests.st index 3551c3e33..75f4d4977 100644 --- a/src/core/ctrl/test/IxCoordination/IxStepTests.st +++ b/src/core/ctrl/test/AxoCoordination/AxoStepTests.st @@ -1,9 +1,9 @@ -USING ix.framework.core; -USING ix.framework.rtc; +USING AXOpen.Core; +USING AXOpen.Rtc; USING AxUnit; -NAMESPACE ix.core.IxStep_Tests - CLASS TestContext IMPLEMENTS ix.framework.core.IIxContext +NAMESPACE AXOpen.Core.AxoStep_Tests + CLASS TestContext IMPLEMENTS IAxoContext VAR PROTECTED _openCounter : ULINT; _closeCounter : ULINT; @@ -30,18 +30,18 @@ NAMESPACE ix.core.IxStep_Tests CreateIdentity := _identityCounter; END_METHOD - METHOD PUBLIC GetRtc : IRtc ; END_METHOD + METHOD PUBLIC GetRtc : IAxoRtc ; END_METHOD - METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IRtc; END_VAR ; END_METHOD + METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IAxoRtc; END_VAR ; END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment ; END_METHOD // METHOD PUBLIC SetContextEnvironment // VAR_INPUT - // inContextEnvironnment : IIxContextEnvironment; + // inContextEnvironnment : IAxoContextEnvironment; // END_VAR // ; @@ -52,10 +52,10 @@ NAMESPACE ix.core.IxStep_Tests CLASS StepTests VAR PROTECTED _context : TestContext; - _stepOne : IxStep; - _stepTwo : IxStep; - _stepThree : IxStep; - _sequencer : IxSequencer; + _stepOne : AxoStep; + _stepTwo : AxoStep; + _stepThree : AxoStep; + _sequencer : AxoSequencer; END_VAR METHOD PRIVATE Initialize _sequencer.Initialize(_context); @@ -65,8 +65,8 @@ NAMESPACE ix.core.IxStep_Tests END_METHOD METHOD Equal : BOOL VAR_INPUT - expected: CoordinatorStates; - actual: CoordinatorStates; + expected: AxoCoordinatorStates; + actual: AxoCoordinatorStates; END_VAR Equal := expected = actual; END_METHOD @@ -83,7 +83,7 @@ NAMESPACE ix.core.IxStep_Tests Assert.Equal(ULINT#2, _stepTwo.GetStepOrder()); _stepThree.Execute(_sequencer); Assert.Equal(ULINT#3, _stepThree.GetStepOrder()); - Assert.Equal(TRUE , THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE , THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); END_METHOD {Test} @@ -100,7 +100,7 @@ NAMESPACE ix.core.IxStep_Tests _stepOne.Execute(_sequencer); _stepTwo.Execute(_sequencer); _stepThree.Execute(_sequencer); - Assert.Equal(TRUE , THIS.Equal(CoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE , THIS.Equal(AxoCoordinatorStates#Configuring , _sequencer.GetCoordinatorState())); _context.Close(); _context.Open(); @@ -108,7 +108,7 @@ NAMESPACE ix.core.IxStep_Tests Assert.Equal(ULINT#1, _stepOne.GetStepOrder()); Assert.Equal(ULINT#2, _stepTwo.GetStepOrder()); Assert.Equal(ULINT#3, _stepThree.GetStepOrder()); - Assert.Equal(TRUE , THIS.Equal(CoordinatorStates#Running , _sequencer.GetCoordinatorState())); + Assert.Equal(TRUE , THIS.Equal(AxoCoordinatorStates#Running , _sequencer.GetCoordinatorState())); END_METHOD {Test} diff --git a/src/core/ctrl/test/IxObject/IxObjectTests.st b/src/core/ctrl/test/AxoObject/AxoObjectTests.st similarity index 90% rename from src/core/ctrl/test/IxObject/IxObjectTests.st rename to src/core/ctrl/test/AxoObject/AxoObjectTests.st index a5f2d0b69..f8bb380bb 100644 --- a/src/core/ctrl/test/IxObject/IxObjectTests.st +++ b/src/core/ctrl/test/AxoObject/AxoObjectTests.st @@ -1,24 +1,24 @@ -USING ix.core; +USING AXOpen.Core; USING AxUnit; -NAMESPACE ix.core.IxObject_Tests +NAMESPACE AXOpen.Core.AxoObject_Tests - CLASS TestObjContext EXTENDS ix.framework.core.IxContext + CLASS TestObjContext EXTENDS AxoContext METHOD PROTECTED OVERRIDE Main ; END_METHOD END_CLASS - CLASS TestObject EXTENDS ix.framework.core.IxObject + CLASS TestObject EXTENDS AxoObject END_CLASS {TestFixture} - CLASS IxObjectUnitTests EXTENDS ix.framework.core.IxObject + CLASS IxObjectUnitTests EXTENDS AxoObject VAR PRIVATE _context : TestObjContext; END_VAR - METHOD PUBLIC OVERRIDE GetContext : IIxContext + METHOD PUBLIC OVERRIDE GetContext : IAxoContext GetContext := _context; END_METHOD diff --git a/src/core/ctrl/test/IxRemoteTask/IxRemoteTaskTests.st b/src/core/ctrl/test/AxoRemoteTask/AxoRemoteTaskTests.st similarity index 82% rename from src/core/ctrl/test/IxRemoteTask/IxRemoteTaskTests.st rename to src/core/ctrl/test/AxoRemoteTask/AxoRemoteTaskTests.st index f701cca29..200b14514 100644 --- a/src/core/ctrl/test/IxRemoteTask/IxRemoteTaskTests.st +++ b/src/core/ctrl/test/AxoRemoteTask/AxoRemoteTaskTests.st @@ -1,12 +1,12 @@ USING AxUnit; -USING ix.framework.core; -USING ix.framework.rtc; +USING AXOpen.Core; +USING AXOpen.Rtc; -NAMESPACE ix.framework.core - NAMESPACE IxRemoteTasksTests +NAMESPACE AXOpen.Core + NAMESPACE AxoRemoteTasksTests - CLASS TestContext IMPLEMENTS ix.framework.core.IIxContext + CLASS TestContext IMPLEMENTS IAxoContext VAR PROTECTED _openCounter : ULINT; _closeCounter : ULINT; @@ -33,12 +33,12 @@ NAMESPACE ix.framework.core CreateIdentity := _identityCounter; END_METHOD - METHOD PUBLIC GetRtc : IRtc ; END_METHOD + METHOD PUBLIC GetRtc : IAxoRtc ; END_METHOD - METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IRtc; END_VAR ; END_METHOD + METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IAxoRtc; END_VAR ; END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment ; END_METHOD END_CLASS @@ -47,9 +47,9 @@ NAMESPACE ix.framework.core CLASS IxRemoteTaskTests VAR PROTECTED _context : TestContext; - myTask : IxRemoteTask; - expState: eIxTaskState; - actState: eIxTaskState; + myTask : AxoRemoteTask; + expState: eAxoTaskState; + actState: eAxoTaskState; initValue : ULINT; END_VAR @@ -59,8 +59,8 @@ NAMESPACE ix.framework.core METHOD Equal : BOOL VAR_INPUT - expected: eIxTaskState; - actual: eIxTaskState; + expected: eAxoTaskState; + actual: eAxoTaskState; END_VAR Equal := expected = actual; END_METHOD @@ -109,7 +109,7 @@ NAMESPACE ix.framework.core _context.Open(); myTask.SetDoneSignature(); myTask.Execute(); - THIS.Equal(eIxTaskState#Done, myTask.Status); + THIS.Equal(eAxoTaskState#Done, myTask.Status); Assert.Equal(FALSE, myTask.Execute()); _context.Close(); END_METHOD diff --git a/src/core/ctrl/test/IxTask/IxTaskTests.st b/src/core/ctrl/test/AxoTask/AxoTaskTests.st similarity index 89% rename from src/core/ctrl/test/IxTask/IxTaskTests.st rename to src/core/ctrl/test/AxoTask/AxoTaskTests.st index 3e16d7995..30f838b16 100644 --- a/src/core/ctrl/test/IxTask/IxTaskTests.st +++ b/src/core/ctrl/test/AxoTask/AxoTaskTests.st @@ -1,10 +1,9 @@ -USING ix.core; USING AxUnit; -USING ix.framework.core; -USING ix.framework.rtc; +USING AXOpen.Core; +USING AXOpen.Rtc; -NAMESPACE ix.core.IxTask_Tests - CLASS TestContext IMPLEMENTS ix.framework.core.IIxContext +NAMESPACE AXOpen.Core.AxoTask_Tests + CLASS TestContext IMPLEMENTS IAxoContext VAR PROTECTED _openCounter : ULINT; _closeCounter : ULINT; @@ -31,17 +30,17 @@ NAMESPACE ix.core.IxTask_Tests CreateIdentity := _identityCounter; END_METHOD - METHOD PUBLIC GetRtc : IRtc ; END_METHOD + METHOD PUBLIC GetRtc : IAxoRtc ; END_METHOD - METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IRtc; END_VAR ; END_METHOD + METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IAxoRtc; END_VAR ; END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment ; END_METHOD END_CLASS - CLASS MyTask Extends IxTask + CLASS MyTask Extends AxoTask VAR OnAbortCounter : ULINT; OnResumeCounter : ULINT; @@ -113,8 +112,8 @@ NAMESPACE ix.core.IxTask_Tests VAR PROTECTED _context : TestContext; myTask : MyTask; - expState: eIxTaskState; - actState: eIxTaskState; + expState: eAxoTaskState; + actState: eAxoTaskState; initValue : ULINT; END_VAR @@ -159,8 +158,8 @@ NAMESPACE ix.core.IxTask_Tests METHOD Equal : BOOL VAR_INPUT - expected: eIxTaskState; - actual: eIxTaskState; + expected: eAxoTaskState; + actual: eAxoTaskState; END_VAR Equal := expected = actual; END_METHOD @@ -170,7 +169,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Ready; + expState := eAxoTaskState#Ready; // Act/Assert Assert.Equal(TRUE, THIS.Equal(expState, myTask.GetState())); END_METHOD @@ -180,7 +179,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Ready; + expState := eAxoTaskState#Ready; // Act/Assert THIS.Initialize(); Assert.Equal(TRUE, THIS.Equal(expState, myTask.GetState())); @@ -191,7 +190,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Kicking; + expState := eAxoTaskState#Kicking; // Act/Assert myTask.Invoke(); Assert.Equal(TRUE, THIS.Equal(expState, myTask.GetState())); @@ -221,7 +220,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Busy; + expState := eAxoTaskState#Busy; // Act/Assert myTask.Invoke(); myTask.Execute(); @@ -234,7 +233,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Done; + expState := eAxoTaskState#Done; // Act/Assert myTask.Invoke(); myTask.Execute(); @@ -248,7 +247,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Busy; + expState := eAxoTaskState#Busy; // Act/Assert myTask.Invoke(); myTask.Execute(); @@ -262,7 +261,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Busy; + expState := eAxoTaskState#Busy; // Act/Assert myTask.Invoke(); IF myTask.Execute() THEN @@ -277,7 +276,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Error; + expState := eAxoTaskState#Error; // Act/Assert myTask.Invoke(); IF myTask.Execute() THEN @@ -298,7 +297,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Error; + expState := eAxoTaskState#Error; // Act/Assert myTask.Invoke(); IF myTask.Execute() THEN @@ -384,7 +383,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Error; + expState := eAxoTaskState#Error; // Act/Assert myTask.Invoke(); IF myTask.Execute() THEN @@ -404,7 +403,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Error; + expState := eAxoTaskState#Error; // Act/Assert myTask.Invoke(); IF myTask.Execute() THEN @@ -419,7 +418,7 @@ NAMESPACE ix.core.IxTask_Tests myTask.DoneWhen(TRUE); actState := myTask.GetState(); Assert.Equal(TRUE, THIS.Equal(expState, actState)); - expState := eIxTaskState#Ready; + expState := eAxoTaskState#Ready; myTask.Restore(); actState := myTask.GetState(); Assert.Equal(TRUE, THIS.Equal(expState, actState)); @@ -430,7 +429,7 @@ NAMESPACE ix.core.IxTask_Tests // Arrange THIS.Initialize(); _context.Open(); - expState := eIxTaskState#Error; + expState := eAxoTaskState#Error; // Act/Assert myTask.Invoke(); IF myTask.Execute() THEN @@ -446,7 +445,7 @@ NAMESPACE ix.core.IxTask_Tests myTask.DoneWhen(TRUE); actState := myTask.GetState(); Assert.Equal(TRUE, THIS.Equal(expState, actState)); - expState := eIxTaskState#Disabled; + expState := eAxoTaskState#Disabled; myTask.Restore(); actState := myTask.GetState(); Assert.Equal(TRUE, THIS.Equal(expState, actState)); @@ -470,7 +469,7 @@ NAMESPACE ix.core.IxTask_Tests METHOD PUBLIC execution_of_the_invoked_task_should_not_start_after_any_empty_cycles THIS.Initialize(); myTask.Invoke(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Kicking,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Kicking,myTask.GetState())); _context.Open(); _context.Close(); @@ -478,7 +477,7 @@ NAMESPACE ix.core.IxTask_Tests _context.Open(); Assert.Equal(FALSE ,myTask.Execute()); - Assert.Equal(FALSE,THIS.Equal(eIxTaskState#Busy,myTask.GetState())); + Assert.Equal(FALSE,THIS.Equal(eAxoTaskState#Busy,myTask.GetState())); _context.Close(); END_METHOD @@ -486,9 +485,9 @@ NAMESPACE ix.core.IxTask_Tests METHOD PUBLIC execution_of_the_invoked_task_should_start_when_execute_is_called_after_invoke_in_the_same_PLC_cycle THIS.Initialize(); myTask.Invoke(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Kicking,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Kicking,myTask.GetState())); Assert.Equal(TRUE ,myTask.Execute()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Busy,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Busy,myTask.GetState())); END_METHOD {Test} @@ -496,12 +495,12 @@ NAMESPACE ix.core.IxTask_Tests THIS.Initialize(); _context.Open(); myTask.Invoke(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Kicking,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Kicking,myTask.GetState())); _context.Close(); _context.Open(); Assert.Equal(TRUE ,myTask.Execute()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Busy,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Busy,myTask.GetState())); _context.Close(); END_METHOD @@ -646,13 +645,13 @@ NAMESPACE ix.core.IxTask_Tests myTask.Restore(); _context.Close(); initValue := myTask.GetOnAbortCounter(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); _context.Open(); myTask.Abort(); myTask.Execute(); Assert.Equal(initValue,myTask.GetOnAbortCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); _context.Close(); END_METHOD @@ -660,13 +659,13 @@ NAMESPACE ix.core.IxTask_Tests METHOD PUBLIC abort_should_not_affect_the_task_task_in_error_state_nor_onabort_should_be_triggered THIS.InitializeInvokeExecuteThrowWhen(); initValue := myTask.GetOnAbortCounter(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Error,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Error,myTask.GetState())); _context.Open(); myTask.Abort(); myTask.Execute(); Assert.Equal(initValue,myTask.GetOnAbortCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Error,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Error,myTask.GetState())); _context.Close(); END_METHOD @@ -674,13 +673,13 @@ NAMESPACE ix.core.IxTask_Tests METHOD PUBLIC abort_should_not_affect_the_task_task_in_done_state_nor_onabort_should_be_triggered THIS.InitializeInvokeExecuteDoneWhen(); initValue := myTask.GetOnAbortCounter(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Done,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Done,myTask.GetState())); _context.Open(); myTask.Abort(); myTask.Execute(); Assert.Equal(initValue,myTask.GetOnAbortCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Done,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Done,myTask.GetState())); _context.Close(); END_METHOD @@ -692,7 +691,7 @@ NAMESPACE ix.core.IxTask_Tests _context.Open(); myTask.Restore(); Assert.Equal(initValue + ULINT#1,myTask.GetOnRestoreCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); _context.Close(); END_METHOD @@ -704,7 +703,7 @@ NAMESPACE ix.core.IxTask_Tests _context.Open(); myTask.Restore(); Assert.Equal(initValue + ULINT#1,myTask.GetOnRestoreCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); _context.Close(); END_METHOD @@ -716,7 +715,7 @@ NAMESPACE ix.core.IxTask_Tests _context.Open(); myTask.Restore(); Assert.Equal(initValue + ULINT#1,myTask.GetOnRestoreCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); _context.Close(); END_METHOD @@ -726,13 +725,13 @@ NAMESPACE ix.core.IxTask_Tests _context.Open(); myTask.Restore(); _context.Close(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); initValue := myTask.GetOnRestoreCounter(); _context.Open(); myTask.Restore(); Assert.Equal(initValue + ULINT#1,myTask.GetOnRestoreCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); _context.Close(); END_METHOD //****************** @@ -780,13 +779,13 @@ NAMESPACE ix.core.IxTask_Tests myTask.Restore(); _context.Close(); initValue := myTask.GetOnResumeCounter(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); _context.Open(); myTask.Resume(); myTask.Execute(); Assert.Equal(initValue,myTask.GetOnResumeCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Ready,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Ready,myTask.GetState())); _context.Close(); END_METHOD @@ -794,13 +793,13 @@ NAMESPACE ix.core.IxTask_Tests METHOD PUBLIC resume_should_not_affect_the_task_task_in_error_state_nor_onresume_should_be_triggered THIS.InitializeInvokeExecuteThrowWhen(); initValue := myTask.GetOnResumeCounter(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Error,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Error,myTask.GetState())); _context.Open(); myTask.Resume(); myTask.Execute(); Assert.Equal(initValue,myTask.GetOnResumeCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Error,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Error,myTask.GetState())); _context.Close(); END_METHOD @@ -808,13 +807,13 @@ NAMESPACE ix.core.IxTask_Tests METHOD PUBLIC resume_should_not_affect_the_task_task_in_done_state_nor_onresume_should_be_triggered THIS.InitializeInvokeExecuteDoneWhen(); initValue := myTask.GetOnResumeCounter(); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Done,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Done,myTask.GetState())); _context.Open(); myTask.Resume(); myTask.Execute(); Assert.Equal(initValue,myTask.GetOnResumeCounter()); - Assert.Equal(TRUE,THIS.Equal(eIxTaskState#Done,myTask.GetState())); + Assert.Equal(TRUE,THIS.Equal(eAxoTaskState#Done,myTask.GetState())); _context.Close(); END_METHOD diff --git a/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentCommandView.razor b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentCommandView.razor new file mode 100644 index 000000000..bc8a8de17 --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentCommandView.razor @@ -0,0 +1,4 @@ +@namespace AXOpen.Core +@inherits RenderableComplexComponentBase + + \ No newline at end of file diff --git a/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentStatusView.razor b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentStatusView.razor new file mode 100644 index 000000000..738c365f2 --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentStatusView.razor @@ -0,0 +1,4 @@ +@namespace AXOpen.Core +@inherits RenderableComplexComponentBase + + diff --git a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentView.razor b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor similarity index 94% rename from src/core/src/ix.framework.core.blazor/IxComponent/IxComponentView.razor rename to src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor index 6d1397000..c33cc41b0 100644 --- a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentView.razor +++ b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor @@ -1,8 +1,8 @@ -@namespace ix.framework.core +@namespace AXOpen.Core @using AXSharp.Connector.ValueTypes @using AXSharp.Connector; @using AXSharp.Presentation.Blazor.Controls.Layouts.TabControlComponents; -@inherits RenderableComplexComponentBase; +@inherits RenderableComplexComponentBase;
diff --git a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.cs similarity index 97% rename from src/core/src/ix.framework.core.blazor/IxComponent/IxComponentView.razor.cs rename to src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.cs index 9525a9eb5..38feef93d 100644 --- a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentView.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.cs @@ -1,10 +1,10 @@ using AXSharp.Connector; using Microsoft.AspNetCore.Components; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxComponentView : IDisposable + public partial class AxoComponentView : IDisposable { private bool isCollapsed = true; private string currentPresentation = "Status-Display"; diff --git a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentView.razor.css b/src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.css similarity index 100% rename from src/core/src/ix.framework.core.blazor/IxComponent/IxComponentView.razor.css rename to src/core/src/AXOpen.Core.Blazor/AxoComponent/AxoComponentView.razor.css diff --git a/src/core/src/ix.framework.core.blazor/IxComponent/DetailsContext.cs b/src/core/src/AXOpen.Core.Blazor/AxoComponent/DetailsContext.cs similarity index 99% rename from src/core/src/ix.framework.core.blazor/IxComponent/DetailsContext.cs rename to src/core/src/AXOpen.Core.Blazor/AxoComponent/DetailsContext.cs index b4fca7a6c..28861f55d 100644 --- a/src/core/src/ix.framework.core.blazor/IxComponent/DetailsContext.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoComponent/DetailsContext.cs @@ -1,7 +1,7 @@ using AXSharp.Connector; using AXSharp.Connector.Localizations; -namespace ix.framework.core +namespace AXOpen.Core { public class DetailsContext : ITwinObject { diff --git a/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerCommandView.razor b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerCommandView.razor new file mode 100644 index 000000000..1e9547c89 --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerCommandView.razor @@ -0,0 +1,4 @@ +@namespace AXOpen.Core +@inherits RenderableComplexComponentBase + + \ No newline at end of file diff --git a/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerStatusView.razor b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerStatusView.razor new file mode 100644 index 000000000..191ad729c --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerStatusView.razor @@ -0,0 +1,4 @@ +@namespace AXOpen.Core +@inherits RenderableComplexComponentBase + + \ No newline at end of file diff --git a/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerView.razor b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerView.razor similarity index 83% rename from src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerView.razor rename to src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerView.razor index 7f0c2f43d..0da606fa3 100644 --- a/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerView.razor +++ b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerView.razor @@ -1,16 +1,16 @@ -@namespace ix.framework.core -@inherits RenderableComplexComponentBase +@namespace AXOpen.Core +@inherits RenderableComplexComponentBase
@if (IsControllable) { - + } else { - + }
diff --git a/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerView.razor.cs similarity index 87% rename from src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerView.razor.cs rename to src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerView.razor.cs index c5c1ef485..f49b0e1cd 100644 --- a/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerView.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoSequencer/AxoSequencerView.razor.cs @@ -1,9 +1,9 @@ using AXSharp.Connector; using Microsoft.AspNetCore.Components; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxSequencerView : IDisposable + public partial class AxoSequencerView : IDisposable { private bool isControllable; diff --git a/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepCommandView.razor b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepCommandView.razor new file mode 100644 index 000000000..03ffdc7c2 --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepCommandView.razor @@ -0,0 +1,6 @@ +@namespace AXOpen.Core +@using AXSharp.Connector.ValueTypes +@using AXSharp.Connector +@inherits RenderableComplexComponentBase + + \ No newline at end of file diff --git a/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepStatusView.razor b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepStatusView.razor new file mode 100644 index 000000000..510cb90ec --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepStatusView.razor @@ -0,0 +1,4 @@ +@namespace AXOpen.Core +@inherits RenderableComplexComponentBase + + diff --git a/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepView.razor b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepView.razor similarity index 63% rename from src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepView.razor rename to src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepView.razor index b3b3e9046..27a310105 100644 --- a/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepView.razor +++ b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepView.razor @@ -1,20 +1,20 @@ -@namespace ix.framework.core +@namespace AXOpen.Core @using AXSharp.Connector.ValueTypes; @using AXSharp.Connector; -@inherits RenderableComplexComponentBase +@inherits RenderableComplexComponentBase @implements IDisposable;
- @*Left here for the future, just to store the idea that each step could be displayed as an IxTask *@ + @*Left here for the future, just to store the idea that each step could be displayed as an AxoTask *@ @* @if (IsControllable) { - + } else { - + }*@ @Description
diff --git a/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepView.razor.cs similarity index 82% rename from src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepView.razor.cs rename to src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepView.razor.cs index f02971dfa..53eb746e6 100644 --- a/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepView.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepView.razor.cs @@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components; using System.Reflection.Metadata.Ecma335; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxStepView + public partial class AxoStepView { private bool isControllable; @@ -15,24 +15,24 @@ public partial class IxStepView private void UpdateStepRowColors(object sender, EventArgs e) { - switch ((eIxTaskState)Component.Status.LastValue) + switch ((eAxoTaskState)Component.Status.LastValue) { - case eIxTaskState.Disabled: + case eAxoTaskState.Disabled: RowClass = "bg-secondary text-white"; break; - case eIxTaskState.Ready: + case eAxoTaskState.Ready: RowClass = "bg-primary text-white"; break; - case eIxTaskState.Kicking: + case eAxoTaskState.Kicking: RowClass = "bg-light text-dark"; break; - case eIxTaskState.Busy: + case eAxoTaskState.Busy: RowClass = "bg-warning text-dark"; break; - case eIxTaskState.Done: + case eAxoTaskState.Done: RowClass = "bg-success text-white"; break; - case eIxTaskState.Error: + case eAxoTaskState.Error: RowClass = "bg-danger text-white"; break; default: diff --git a/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskCommandView.razor b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskCommandView.razor new file mode 100644 index 000000000..224db6d76 --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskCommandView.razor @@ -0,0 +1,4 @@ +@namespace AXOpen.Core +@inherits RenderableComplexComponentBase + + diff --git a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskCommandView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskCommandView.razor.cs similarity index 91% rename from src/core/src/ix.framework.core.blazor/IxTask/IxTaskCommandView.razor.cs rename to src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskCommandView.razor.cs index 880034031..0d0c7148c 100644 --- a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskCommandView.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskCommandView.razor.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Components; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxTaskCommandView + public partial class AxoTaskCommandView { private string description; [Parameter] diff --git a/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskStatusView.razor b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskStatusView.razor new file mode 100644 index 000000000..78d919d8a --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskStatusView.razor @@ -0,0 +1,4 @@ +@namespace AXOpen.Core +@inherits RenderableComplexComponentBase + + diff --git a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskStatusView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskStatusView.razor.cs similarity index 91% rename from src/core/src/ix.framework.core.blazor/IxTask/IxTaskStatusView.razor.cs rename to src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskStatusView.razor.cs index 2e0e42bc1..29c3f83cf 100644 --- a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskStatusView.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskStatusView.razor.cs @@ -1,9 +1,9 @@ using AXSharp.Connector; using Microsoft.AspNetCore.Components; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxTaskStatusView + public partial class AxoTaskStatusView { private string description; [Parameter] diff --git a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskView.razor b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskView.razor similarity index 95% rename from src/core/src/ix.framework.core.blazor/IxTask/IxTaskView.razor rename to src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskView.razor index ce8e77990..e2cb5ad86 100644 --- a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskView.razor +++ b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskView.razor @@ -1,6 +1,6 @@ -@namespace ix.framework.core +@namespace AXOpen.Core @using AXSharp.Connector; -@inherits RenderableComplexComponentBase +@inherits RenderableComplexComponentBase @implements IDisposable;
diff --git a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskView.razor.cs b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskView.razor.cs similarity index 86% rename from src/core/src/ix.framework.core.blazor/IxTask/IxTaskView.razor.cs rename to src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskView.razor.cs index 6671b0dcf..c9968d788 100644 --- a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskView.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/AxoTask/AxoTaskView.razor.cs @@ -1,9 +1,9 @@ using AXSharp.Connector; using Microsoft.AspNetCore.Components; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxTaskView : IDisposable + public partial class AxoTaskView : IDisposable { private string description; private bool hideRestoreButton; @@ -13,7 +13,7 @@ private void InvokeTask() } private void RestoreTask() { - (this.Component as IxRemoteTask)?.ResetExecution(); + (this.Component as AxoRemoteTask)?.ResetExecution(); Component.RemoteRestore.Cyclic = true; } private void AbortTask() @@ -26,17 +26,17 @@ private void ResumeTask() } private string ButtonClass = "btn-primary"; - private bool IsTaskRunning => Component.Status.Cyclic == (ushort)eIxTaskState.Busy; - private bool IsTaskAborted => Component.Status.Cyclic == (ushort)eIxTaskState.Aborted; + private bool IsTaskRunning => Component.Status.Cyclic == (ushort)eAxoTaskState.Busy; + private bool IsTaskAborted => Component.Status.Cyclic == (ushort)eAxoTaskState.Aborted; private void UpdateTaskColor(object sender, EventArgs e) { - switch ((eIxTaskState)Component.Status.LastValue) + switch ((eAxoTaskState)Component.Status.LastValue) { - case eIxTaskState.Done: + case eAxoTaskState.Done: ButtonClass = "btn-success"; break; - case eIxTaskState.Error: + case eAxoTaskState.Error: ButtonClass = "btn-danger"; break; default: diff --git a/src/core/src/ix.framework.core.blazor/ExampleJsInterop.cs b/src/core/src/AXOpen.Core.Blazor/ExampleJsInterop.cs similarity index 100% rename from src/core/src/ix.framework.core.blazor/ExampleJsInterop.cs rename to src/core/src/AXOpen.Core.Blazor/ExampleJsInterop.cs diff --git a/src/core/src/ix.framework.core.blazor/Properties/AssemblyInfo.cs b/src/core/src/AXOpen.Core.Blazor/Properties/AssemblyInfo.cs similarity index 100% rename from src/core/src/ix.framework.core.blazor/Properties/AssemblyInfo.cs rename to src/core/src/AXOpen.Core.Blazor/Properties/AssemblyInfo.cs diff --git a/src/core/src/ix.framework.core.blazor/Toaster/Toast.cs b/src/core/src/AXOpen.Core.Blazor/Toaster/Toast.cs similarity index 93% rename from src/core/src/ix.framework.core.blazor/Toaster/Toast.cs rename to src/core/src/AXOpen.Core.Blazor/Toaster/Toast.cs index b079b812e..860bb8a17 100644 --- a/src/core/src/ix.framework.core.blazor/Toaster/Toast.cs +++ b/src/core/src/AXOpen.Core.Blazor/Toaster/Toast.cs @@ -1,6 +1,6 @@ using CommunityToolkit.Mvvm.Messaging.Messages; -namespace ix.framework.core.blazor.Toaster +namespace AXOpen.Core.blazor.Toaster { public class Toast { diff --git a/src/core/src/ix.framework.core.blazor/Toaster/ToastMessage.cs b/src/core/src/AXOpen.Core.Blazor/Toaster/ToastMessage.cs similarity index 82% rename from src/core/src/ix.framework.core.blazor/Toaster/ToastMessage.cs rename to src/core/src/AXOpen.Core.Blazor/Toaster/ToastMessage.cs index 3bc532716..453d82283 100644 --- a/src/core/src/ix.framework.core.blazor/Toaster/ToastMessage.cs +++ b/src/core/src/AXOpen.Core.Blazor/Toaster/ToastMessage.cs @@ -1,12 +1,12 @@ using CommunityToolkit.Mvvm.Messaging.Messages; -using ix.framework.core.blazor.Toaster; +using AXOpen.Core.blazor.Toaster; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ix.framework.core +namespace AXOpen.Core { public class ToastMessage : ValueChangedMessage { diff --git a/src/core/src/ix.framework.core.blazor/Toaster/ToastService.cs b/src/core/src/AXOpen.Core.Blazor/Toaster/ToastService.cs similarity index 98% rename from src/core/src/ix.framework.core.blazor/Toaster/ToastService.cs rename to src/core/src/AXOpen.Core.Blazor/Toaster/ToastService.cs index a85a196ea..a566dec36 100644 --- a/src/core/src/ix.framework.core.blazor/Toaster/ToastService.cs +++ b/src/core/src/AXOpen.Core.Blazor/Toaster/ToastService.cs @@ -1,7 +1,7 @@ using CommunityToolkit.Mvvm.Messaging; using System.Timers; -namespace ix.framework.core.blazor.Toaster +namespace AXOpen.Core.blazor.Toaster { public class ToastService : IDisposable { diff --git a/src/core/src/ix.framework.core.blazor/Toaster/Toaster.razor b/src/core/src/AXOpen.Core.Blazor/Toaster/Toaster.razor similarity index 98% rename from src/core/src/ix.framework.core.blazor/Toaster/Toaster.razor rename to src/core/src/AXOpen.Core.Blazor/Toaster/Toaster.razor index a1ef6b642..67cb11533 100644 --- a/src/core/src/ix.framework.core.blazor/Toaster/Toaster.razor +++ b/src/core/src/AXOpen.Core.Blazor/Toaster/Toaster.razor @@ -1,4 +1,4 @@ -@namespace ix.framework.core.blazor.Toaster +@namespace AXOpen.Core.blazor.Toaster @if (toastService.GetToasts() != null && toastService.GetToasts().Count > 0) {
diff --git a/src/core/src/ix.framework.core.blazor/Toaster/Toaster.razor.cs b/src/core/src/AXOpen.Core.Blazor/Toaster/Toaster.razor.cs similarity index 92% rename from src/core/src/ix.framework.core.blazor/Toaster/Toaster.razor.cs rename to src/core/src/AXOpen.Core.Blazor/Toaster/Toaster.razor.cs index a2d14a2e8..25eb87d03 100644 --- a/src/core/src/ix.framework.core.blazor/Toaster/Toaster.razor.cs +++ b/src/core/src/AXOpen.Core.Blazor/Toaster/Toaster.razor.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Components; -namespace ix.framework.core.blazor.Toaster +namespace AXOpen.Core.blazor.Toaster { public partial class Toaster : ComponentBase, IDisposable { diff --git a/src/core/src/ix.framework.core.blazor/_Imports.razor b/src/core/src/AXOpen.Core.Blazor/_Imports.razor similarity index 100% rename from src/core/src/ix.framework.core.blazor/_Imports.razor rename to src/core/src/AXOpen.Core.Blazor/_Imports.razor diff --git a/src/core/src/AXOpen.Core.Blazor/axopen_core_blazor.csproj b/src/core/src/AXOpen.Core.Blazor/axopen_core_blazor.csproj new file mode 100644 index 000000000..78b2354a5 --- /dev/null +++ b/src/core/src/AXOpen.Core.Blazor/axopen_core_blazor.csproj @@ -0,0 +1,34 @@ + + + + net7.0 + enable + enable + AXOpen.Core.Blazor + AXOpen.Core.Blazor + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + diff --git a/src/core/src/ix.framework.core.blazor/package-lock.json b/src/core/src/AXOpen.Core.Blazor/package-lock.json similarity index 100% rename from src/core/src/ix.framework.core.blazor/package-lock.json rename to src/core/src/AXOpen.Core.Blazor/package-lock.json diff --git a/src/core/src/ix.framework.core.blazor/wwwroot/background.png b/src/core/src/AXOpen.Core.Blazor/wwwroot/background.png similarity index 100% rename from src/core/src/ix.framework.core.blazor/wwwroot/background.png rename to src/core/src/AXOpen.Core.Blazor/wwwroot/background.png diff --git a/src/core/src/ix.framework.core.blazor/wwwroot/exampleJsInterop.js b/src/core/src/AXOpen.Core.Blazor/wwwroot/exampleJsInterop.js similarity index 100% rename from src/core/src/ix.framework.core.blazor/wwwroot/exampleJsInterop.js rename to src/core/src/AXOpen.Core.Blazor/wwwroot/exampleJsInterop.js diff --git a/src/core/src/ix.framework.core/IxComponent/IxComponent.cs b/src/core/src/AXOpen.Core/AxoComponent/AxoComponent.cs similarity index 91% rename from src/core/src/ix.framework.core/IxComponent/IxComponent.cs rename to src/core/src/AXOpen.Core/AxoComponent/AxoComponent.cs index 01eb87509..92bc94078 100644 --- a/src/core/src/ix.framework.core/IxComponent/IxComponent.cs +++ b/src/core/src/AXOpen.Core/AxoComponent/AxoComponent.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading.Tasks; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxComponent + public partial class AxoComponent { diff --git a/src/core/src/ix.framework.core/IxCoordination/IxSequencer.cs b/src/core/src/AXOpen.Core/AxoCoordination/AxoSequencer.cs similarity index 79% rename from src/core/src/ix.framework.core/IxCoordination/IxSequencer.cs rename to src/core/src/AXOpen.Core/AxoCoordination/AxoSequencer.cs index 86affd3d5..4c167159b 100644 --- a/src/core/src/ix.framework.core/IxCoordination/IxSequencer.cs +++ b/src/core/src/AXOpen.Core/AxoCoordination/AxoSequencer.cs @@ -1,13 +1,13 @@ -// ix.framework.core +// AXOpen.Core // Copyright (c)2022 Peter Kurhajec and Contributors All Rights Reserved. // Contributors: https://github.com/PTKu/ix/graphs/contributors // See the LICENSE file in the repository root for more information. // https://github.com/PTKu/ix/blob/master/LICENSE // Third party licenses: https://github.com/PTKu/ix/blob/master/notices.md -namespace ix.framework.core; +namespace AXOpen.Core; -public partial class IxSequencer +public partial class AxoSequencer { } \ No newline at end of file diff --git a/src/core/src/ix.framework.core/IxCoordination/IxStep.cs b/src/core/src/AXOpen.Core/AxoCoordination/AxoStep.cs similarity index 70% rename from src/core/src/ix.framework.core/IxCoordination/IxStep.cs rename to src/core/src/AXOpen.Core/AxoCoordination/AxoStep.cs index aa120b107..1d1c210a7 100644 --- a/src/core/src/ix.framework.core/IxCoordination/IxStep.cs +++ b/src/core/src/AXOpen.Core/AxoCoordination/AxoStep.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading.Tasks; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxStep + public partial class AxoStep { } diff --git a/src/core/src/ix.framework.core/IxRemoteTask/IxRemoteTask.cs b/src/core/src/AXOpen.Core/AxoRemoteTask/AxoRemoteTask.cs similarity index 84% rename from src/core/src/ix.framework.core/IxRemoteTask/IxRemoteTask.cs rename to src/core/src/AXOpen.Core/AxoRemoteTask/AxoRemoteTask.cs index 98fb03230..9430ae8d9 100644 --- a/src/core/src/ix.framework.core/IxRemoteTask/IxRemoteTask.cs +++ b/src/core/src/AXOpen.Core/AxoRemoteTask/AxoRemoteTask.cs @@ -3,18 +3,18 @@ using System.ComponentModel; using System.Threading.Tasks; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxRemoteTask + public partial class AxoRemoteTask { internal Action DeferredAction { get; private set; } public event PropertyChangedEventHandler PropertyChanged; /// - /// Initializes this . + /// Initializes this . /// - /// Action to be executed on this call. + /// Action to be executed on this call. public void Initialize(Action deferredAction) { DeferredAction = deferredAction; @@ -24,9 +24,9 @@ public void Initialize(Action deferredAction) } /// - /// Initializes this . + /// Initializes this . /// - /// Action to be executed on this call. + /// Action to be executed on this call. public void Initialize(Func deferredAction) { DeferredAction = new Action(() => deferredAction()); @@ -38,10 +38,10 @@ public void Initialize(Func deferredAction) private int _defferedActionCount; /// - /// Initializes this exclusively for this . Any following attempt - /// to initialize this will throw an exception. + /// Initializes this exclusively for this . Any following attempt + /// to initialize this will throw an exception. /// - /// Action to be executed on this call. + /// Action to be executed on this call. public void InitializeExclusively(Action deferredAction) { @@ -57,10 +57,10 @@ public void InitializeExclusively(Action deferredAction) } /// - /// Initializes this exclusively for this . Any following attempt - /// to initialize this will throw an exception. + /// Initializes this exclusively for this . Any following attempt + /// to initialize this will throw an exception. /// - /// Action to be executed on this call. + /// Action to be executed on this call. public void InitializeExclusively(Func deferredAction) { @@ -76,7 +76,7 @@ public void InitializeExclusively(Func deferredAction) } /// - /// Removes currently bound from the execution of this + /// Removes currently bound from the execution of this /// public void DeInitialize() { @@ -155,10 +155,10 @@ private set } /// - /// Resets the resets this instance of . + /// Resets the resets this instance of . /// /// If the procedure is being called from the PLC, once the method is called the execution of this - /// will start again. + /// will start again. public async Task ResetExecution() { await this.StartSignature.SetAsync(0); diff --git a/src/core/src/ix.framework.core/IxRemoteTask/MultipleRemoteCallInitializationException.cs b/src/core/src/AXOpen.Core/AxoRemoteTask/MultipleRemoteCallInitializationException.cs similarity index 98% rename from src/core/src/ix.framework.core/IxRemoteTask/MultipleRemoteCallInitializationException.cs rename to src/core/src/AXOpen.Core/AxoRemoteTask/MultipleRemoteCallInitializationException.cs index 9febf5b3a..8e7a4b06f 100644 --- a/src/core/src/ix.framework.core/IxRemoteTask/MultipleRemoteCallInitializationException.cs +++ b/src/core/src/AXOpen.Core/AxoRemoteTask/MultipleRemoteCallInitializationException.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace ix.framework.core +namespace AXOpen.Core { public class MultipleRemoteCallInitializationException : Exception { diff --git a/src/core/src/ix.framework.core/IxTask/IxTask.cs b/src/core/src/AXOpen.Core/AxoTask/AxoTask.cs similarity index 93% rename from src/core/src/ix.framework.core/IxTask/IxTask.cs rename to src/core/src/AXOpen.Core/AxoTask/AxoTask.cs index 3375aa475..ed0913fca 100644 --- a/src/core/src/ix.framework.core/IxTask/IxTask.cs +++ b/src/core/src/AXOpen.Core/AxoTask/AxoTask.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Windows.Input; -namespace ix.framework.core +namespace AXOpen.Core { - public partial class IxTask : ICommand + public partial class AxoTask : ICommand { /// /// Restore this task to ready state. diff --git a/src/core/src/AXOpen.Core/Properties/AssemblyInfo.cs b/src/core/src/AXOpen.Core/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5abc351bd --- /dev/null +++ b/src/core/src/AXOpen.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; + +[assembly:InternalsVisibleTo("axopen_core_tests")] \ No newline at end of file diff --git a/src/core/src/AXOpen.Core/Resources/PlcStringResources.Designer.cs b/src/core/src/AXOpen.Core/Resources/PlcStringResources.Designer.cs new file mode 100644 index 000000000..53c5e8fe4 --- /dev/null +++ b/src/core/src/AXOpen.Core/Resources/PlcStringResources.Designer.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AXOpen.Core.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class PlcStringResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal PlcStringResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AXOpen.Core.Resources.PlcStringResources", typeof(PlcStringResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Command state. + /// + public static string Command_state { + get { + return ResourceManager.GetString("Command_state", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run step. + /// + public static string Run_step { + get { + return ResourceManager.GetString("Run_step", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sequence mode. + /// + public static string Sequence_mode { + get { + return ResourceManager.GetString("Sequence_mode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stepping mode. + /// + public static string Stepping_mode { + get { + return ResourceManager.GetString("Stepping_mode", resourceCulture); + } + } + } +} diff --git a/src/core/src/AXOpen.Core/Resources/PlcStringResources.resx b/src/core/src/AXOpen.Core/Resources/PlcStringResources.resx new file mode 100644 index 000000000..0182b2b53 --- /dev/null +++ b/src/core/src/AXOpen.Core/Resources/PlcStringResources.resx @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Command state + src\AxoTask\AxoTask.st,8 + + + Stepping mode + src\AxoCoordination\AxoSequencer\AxoSequencer.st,3 + + + Sequence mode + src\AxoCoordination\AxoSequencer\AxoSequencer.st,5 + + + Run step + src\AxoCoordination\AxoSequencer\AxoSequencer.st,10 + + \ No newline at end of file diff --git a/src/core/src/AXOpen.Core/ix_ax_axopen_core.csproj b/src/core/src/AXOpen.Core/ix_ax_axopen_core.csproj new file mode 100644 index 000000000..4f7d4e58b --- /dev/null +++ b/src/core/src/AXOpen.Core/ix_ax_axopen_core.csproj @@ -0,0 +1,41 @@ + + + net6.0 + enable + enable + AXOpen.Core + AXOpen.Core + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + True + True + PlcStringResources.resx + + + + + + PublicResXFileCodeGenerator + PlcStringResources.Designer.cs + + + \ No newline at end of file diff --git a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentCommandView.razor b/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentCommandView.razor deleted file mode 100644 index cd8ad7679..000000000 --- a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentCommandView.razor +++ /dev/null @@ -1,4 +0,0 @@ -@namespace ix.framework.core -@inherits RenderableComplexComponentBase - - \ No newline at end of file diff --git a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentStatusView.razor b/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentStatusView.razor deleted file mode 100644 index 8f22b15e8..000000000 --- a/src/core/src/ix.framework.core.blazor/IxComponent/IxComponentStatusView.razor +++ /dev/null @@ -1,4 +0,0 @@ -@namespace ix.framework.core -@inherits RenderableComplexComponentBase - - \ No newline at end of file diff --git a/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerCommandView.razor b/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerCommandView.razor deleted file mode 100644 index 3a127bce7..000000000 --- a/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerCommandView.razor +++ /dev/null @@ -1,4 +0,0 @@ -@namespace ix.framework.core -@inherits RenderableComplexComponentBase - - \ No newline at end of file diff --git a/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerStatusView.razor b/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerStatusView.razor deleted file mode 100644 index 6c9543caf..000000000 --- a/src/core/src/ix.framework.core.blazor/IxCoordination/IxSequencer/IxSequencerStatusView.razor +++ /dev/null @@ -1,4 +0,0 @@ -@namespace ix.framework.core -@inherits RenderableComplexComponentBase - - \ No newline at end of file diff --git a/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepCommandView.razor b/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepCommandView.razor deleted file mode 100644 index fe8950d2c..000000000 --- a/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepCommandView.razor +++ /dev/null @@ -1,6 +0,0 @@ -@namespace ix.framework.core -@using AXSharp.Connector.ValueTypes -@using AXSharp.Connector -@inherits RenderableComplexComponentBase - - \ No newline at end of file diff --git a/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepStatusView.razor b/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepStatusView.razor deleted file mode 100644 index 33611cc6f..000000000 --- a/src/core/src/ix.framework.core.blazor/IxCoordination/IxStep/IxStepStatusView.razor +++ /dev/null @@ -1,4 +0,0 @@ -@namespace ix.framework.core -@inherits RenderableComplexComponentBase - - diff --git a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskCommandView.razor b/src/core/src/ix.framework.core.blazor/IxTask/IxTaskCommandView.razor deleted file mode 100644 index bfe1cb529..000000000 --- a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskCommandView.razor +++ /dev/null @@ -1,4 +0,0 @@ -@namespace ix.framework.core -@inherits RenderableComplexComponentBase - - diff --git a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskStatusView.razor b/src/core/src/ix.framework.core.blazor/IxTask/IxTaskStatusView.razor deleted file mode 100644 index cd108b6ca..000000000 --- a/src/core/src/ix.framework.core.blazor/IxTask/IxTaskStatusView.razor +++ /dev/null @@ -1,4 +0,0 @@ -@namespace ix.framework.core -@inherits RenderableComplexComponentBase - - diff --git a/src/core/src/ix.framework.core/Properties/AssemblyInfo.cs b/src/core/src/ix.framework.core/Properties/AssemblyInfo.cs deleted file mode 100644 index f835e5a79..000000000 --- a/src/core/src/ix.framework.core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using System.Runtime.CompilerServices; - -[assembly:InternalsVisibleTo("ix.framework.core.tests")] \ No newline at end of file diff --git a/src/core/src/ix.framework.core/ix_ax_ix_framework_core.csproj b/src/core/src/ix.framework.core/ix_ax_ix_framework_core.csproj deleted file mode 100644 index 84b96efd8..000000000 --- a/src/core/src/ix.framework.core/ix_ax_ix_framework_core.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - net6.0 - enable - enable - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/core/tests/AXOpen.Core.Tests/AxoRemoteTask/AxoRemoteTaskTests.cs b/src/core/tests/AXOpen.Core.Tests/AxoRemoteTask/AxoRemoteTaskTests.cs new file mode 100644 index 000000000..82b31e194 --- /dev/null +++ b/src/core/tests/AXOpen.Core.Tests/AxoRemoteTask/AxoRemoteTaskTests.cs @@ -0,0 +1,101 @@ +using Xunit; +using AXOpen.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Channels; +using System.Threading.Tasks; +using AXSharp.Connector; + +namespace AXOpen.Core.Tests +{ + public class AxoRemoteTaskTests + { + [Fact()] + public void InitializeTest() + { + var a = ConnectorAdapterBuilder.Build().CreateDummy(); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + + sut.Initialize(() => Console.WriteLine("")); + + Assert.True(sut.IsInitialized.GetAsync().Result); + + } + + [Fact()] + public void InitializeTest1() + { + var a = ConnectorAdapterBuilder.Build().CreateDummy(); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + + sut.Initialize(() => true); + + Assert.True(sut.IsInitialized.GetAsync().Result); + } + + [Fact()] + public void InitializeExclusivelyTest() + { + var a = ConnectorAdapterBuilder.Build().CreateDummy(); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + + sut.InitializeExclusively(() => Console.WriteLine("")); + + Assert.True(sut.IsInitialized.GetAsync().Result); + + Assert.Throws(() => sut.InitializeExclusively(() => true)); + } + + [Fact()] + public void InitializeExclusivelyTest1() + { + var a = ConnectorAdapterBuilder.Build().CreateDummy(); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + + sut.InitializeExclusively(() => true); + + Assert.True(sut.IsInitialized.GetAsync().Result); + + Assert.Throws(() => sut.InitializeExclusively(() => true)); + } + + [Fact()] + public void DeInitializeTest() + { + var a = ConnectorAdapterBuilder.Build().CreateDummy(); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + + sut.Initialize(() => true); + + sut.DeInitialize(); + + Assert.False(sut.IsInitialized.GetAsync().Result); + } + + [Fact()] + public async void ResetExecutionTest() + { + var a = ConnectorAdapterBuilder.Build().CreateDummy(); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + sut.GetConnector().BuildAndStart(); + + var mustChange = 0; + sut.Initialize(() => mustChange++); + + await sut.StartSignature.SetAsync(2); + await sut.DoneSignature.SetAsync(1); + + + await sut.ResetExecution(); + + Assert.Equal(0Ul, await sut.StartSignature.GetAsync()); + Assert.Equal(0Ul, await sut.DoneSignature.GetAsync()); + Assert.Equal(string.Empty, await sut.ErrorDetails.GetAsync()); + Assert.False(await sut.HasRemoteException.GetAsync()); + Assert.False(sut.IsRunning); + + } + } +} \ No newline at end of file diff --git a/src/core/tests/AXOpen.Core.Tests/AxoTask/AxoTaskTests.cs b/src/core/tests/AXOpen.Core.Tests/AxoTask/AxoTaskTests.cs new file mode 100644 index 000000000..f9036c530 --- /dev/null +++ b/src/core/tests/AXOpen.Core.Tests/AxoTask/AxoTaskTests.cs @@ -0,0 +1,58 @@ +using AXSharp.Connector; +using AXOpen.Core; + +namespace AXOpen.Core.Tests +{ + using System; + using Xunit; + + public class AxoTaskTests + { + private AxoTask _testClass; + + public AxoTaskTests() + { + var a = ConnectorAdapterBuilder.Build().CreateDummy(); + _testClass = new AxoTask(a.GetConnector(null) as ITwinObject, "a", "b"); + } + + [Fact] + public async Task CanCallCanExecute_true() + { + // Arrange + var parameter = new object(); + await _testClass.IsDisabled.SetAsync(true); + + // Act + var result = _testClass.CanExecute(parameter); + + // Assert + Assert.False(result); + } + + [Fact] + public async Task CanCallCanExecute_false() + { + // Arrange + var parameter = new object(); + await _testClass.IsDisabled.SetAsync(false); + + // Act + var result = _testClass.CanExecute(parameter); + + // Assert + Assert.True(result); + } + + + [Fact] + public async Task CanCallExecute() + { + // Arrange + var parameter = new object(); + + // Act + _testClass.Execute(parameter); + } + } +} \ No newline at end of file diff --git a/src/core/tests/AXOpen.Core.Tests/Usings.cs b/src/core/tests/AXOpen.Core.Tests/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/src/core/tests/AXOpen.Core.Tests/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/src/core/tests/AXOpen.Core.Tests/axopen_core_tests.csproj b/src/core/tests/AXOpen.Core.Tests/axopen_core_tests.csproj new file mode 100644 index 000000000..0514e21c7 --- /dev/null +++ b/src/core/tests/AXOpen.Core.Tests/axopen_core_tests.csproj @@ -0,0 +1,38 @@ + + + + net6.0;net7.0 + enable + enable + + false + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + Always + + + + diff --git a/src/core/tests/AXOpen.Core.Tests/xunit.runner.json b/src/core/tests/AXOpen.Core.Tests/xunit.runner.json new file mode 100644 index 000000000..48e1cffbd --- /dev/null +++ b/src/core/tests/AXOpen.Core.Tests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "parallelizeTestCollections": true, + "maxParallelThreads": -1 +} diff --git a/src/core/tests/ix.famework.core.tests/IxRemoteTask/IxRemoteTaskTests.cs b/src/core/tests/ix.famework.core.tests/IxRemoteTask/IxRemoteTaskTests.cs index 3042ddd75..82b31e194 100644 --- a/src/core/tests/ix.famework.core.tests/IxRemoteTask/IxRemoteTaskTests.cs +++ b/src/core/tests/ix.famework.core.tests/IxRemoteTask/IxRemoteTaskTests.cs @@ -1,5 +1,5 @@ using Xunit; -using ix.framework.core; +using AXOpen.Core; using System; using System.Collections.Generic; using System.Linq; @@ -8,15 +8,15 @@ using System.Threading.Tasks; using AXSharp.Connector; -namespace ix.framework.core.Tests +namespace AXOpen.Core.Tests { - public class IxRemoteTaskTests + public class AxoRemoteTaskTests { [Fact()] public void InitializeTest() { var a = ConnectorAdapterBuilder.Build().CreateDummy(); - var sut = new IxRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); sut.Initialize(() => Console.WriteLine("")); @@ -28,7 +28,7 @@ public void InitializeTest() public void InitializeTest1() { var a = ConnectorAdapterBuilder.Build().CreateDummy(); - var sut = new IxRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); sut.Initialize(() => true); @@ -39,7 +39,7 @@ public void InitializeTest1() public void InitializeExclusivelyTest() { var a = ConnectorAdapterBuilder.Build().CreateDummy(); - var sut = new IxRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); sut.InitializeExclusively(() => Console.WriteLine("")); @@ -52,7 +52,7 @@ public void InitializeExclusivelyTest() public void InitializeExclusivelyTest1() { var a = ConnectorAdapterBuilder.Build().CreateDummy(); - var sut = new IxRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); sut.InitializeExclusively(() => true); @@ -65,7 +65,7 @@ public void InitializeExclusivelyTest1() public void DeInitializeTest() { var a = ConnectorAdapterBuilder.Build().CreateDummy(); - var sut = new IxRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); sut.Initialize(() => true); @@ -78,7 +78,7 @@ public void DeInitializeTest() public async void ResetExecutionTest() { var a = ConnectorAdapterBuilder.Build().CreateDummy(); - var sut = new IxRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); + var sut = new AxoRemoteTask(a.GetConnector(null) as ITwinObject, "a", "b"); sut.GetConnector().BuildAndStart(); var mustChange = 0; diff --git a/src/core/tests/ix.famework.core.tests/IxTask/IxTaskTests.cs b/src/core/tests/ix.famework.core.tests/IxTask/IxTaskTests.cs index 7c2ff8dc4..f9036c530 100644 --- a/src/core/tests/ix.famework.core.tests/IxTask/IxTaskTests.cs +++ b/src/core/tests/ix.famework.core.tests/IxTask/IxTaskTests.cs @@ -1,20 +1,19 @@ using AXSharp.Connector; -using ix.framework.core; +using AXOpen.Core; -namespace ix.framework.coretests +namespace AXOpen.Core.Tests { - using ix.framework.core; using System; using Xunit; - public class IxTaskTests + public class AxoTaskTests { - private IxTask _testClass; + private AxoTask _testClass; - public IxTaskTests() + public AxoTaskTests() { var a = ConnectorAdapterBuilder.Build().CreateDummy(); - _testClass = new IxTask(a.GetConnector(null) as ITwinObject, "a", "b"); + _testClass = new AxoTask(a.GetConnector(null) as ITwinObject, "a", "b"); } [Fact] diff --git a/src/data/ctrl/AXSharp.config.json b/src/data/ctrl/AXSharp.config.json index f1c43c9ec..320f7108c 100644 --- a/src/data/ctrl/AXSharp.config.json +++ b/src/data/ctrl/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"..\\src\\ix.framework.data"} \ No newline at end of file +{"OutputProjectFolder":"..\\src\\AXOpen.Data"} \ No newline at end of file diff --git a/src/data/ctrl/README.md b/src/data/ctrl/README.md index cb5df9cbc..2da3e32a3 100644 --- a/src/data/ctrl/README.md +++ b/src/data/ctrl/README.md @@ -4,11 +4,11 @@ # Basic concepts -## IxContext +## AxoContext -IxContext encapsulates entire application or application units. Any solution may contain one or more contexts, however the each should be considered to be an isolated island and any **direct inter-context access to members must be avoided**. +AxoContext encapsulates entire application or application units. Any solution may contain one or more contexts, however the each should be considered to be an isolated island and any **direct inter-context access to members must be avoided**. -**IMPORTANT** Each IxContext must belong to a single PLC task. Multiple IxContexts can be however running on the same task. +**IMPORTANT** Each AxoContext must belong to a single PLC task. Multiple IxContexts can be however running on the same task. ```mermaid @@ -19,17 +19,17 @@ IxContext encapsulates entire application or application units. Any solution may } ``` -In its basic implementation IxContext has relatively simple interface. The main method is the method where we place all calls of our sub-routines. **In other words the `Main` is the root of the call tree of our program.** +In its basic implementation AxoContext has relatively simple interface. The main method is the method where we place all calls of our sub-routines. **In other words the `Main` is the root of the call tree of our program.** -`Run` method runs the IxContext. It must be called cyclically within a program unit that is attached to a cyclic `task`. +`Run` method runs the AxoContext. It must be called cyclically within a program unit that is attached to a cyclic `task`. -### Why do we need IxContext +### Why do we need AxoContext - `IxContext` provides counters, object identification and other information about the execution of the program. These information is then used by the objects contained at different levels of the IxContext. + `AxoContext` provides counters, object identification and other information about the execution of the program. These information is then used by the objects contained at different levels of the AxoContext. -### How IxContext works +### How AxoContext works -When you call `Run` method on an instance of a IxContext, it will ensure opening IxContext, running `Main` method (root of all your program calls) and IxContext closing. +When you call `Run` method on an instance of a AxoContext, it will ensure opening AxoContext, running `Main` method (root of all your program calls) and AxoContext closing. ```mermaid @@ -39,27 +39,27 @@ When you call `Run` method on an instance of a IxContext, it will ensure opening id1(Open):::run-->id2(#Main*):::main-->id3(Close):::run-->id1 ``` -### How to use IxContext +### How to use AxoContext -Base class for the IxContext is `ix.core.IxContext`. The entry point of call execution of the IxContext is `Main` method. Notice that the `IxContext` class is abstract and cannot be instantiated if not extended. `Main` method must be overridden in derived class notice the use of override keyword and also that the method is `protected` which means the it is visible only from within the `IxContext` and derived classes. +Base class for the AxoContext is `ix.core.AxoContext`. The entry point of call execution of the AxoContext is `Main` method. Notice that the `AxoContext` class is abstract and cannot be instantiated if not extended. `Main` method must be overridden in derived class notice the use of override keyword and also that the method is `protected` which means the it is visible only from within the `AxoContext` and derived classes. - **How to extend IxContext class** + **How to extend AxoContext class** ~~~SmallTalk USING ix.core -CLASS PUBLIC MyContext EXTENDS IxContext +CLASS PUBLIC MyContext EXTENDS AxoContext METHOD PROTECTED OVERRIDE Main - // Here goes all your logic for given IxContext. + // Here goes all your logic for given AxoContext. END_METHOD END_CLASS ~~~ -Cyclical call of the IxContext logic (`Main` method) is ensured when IxContext `Execute` method is called. `Execute` method is public therefore accessible and visible to any part of the program that whishes to call it. +Cyclical call of the AxoContext logic (`Main` method) is ensured when AxoContext `Execute` method is called. `Execute` method is public therefore accessible and visible to any part of the program that whishes to call it. -**How to start IxContext's execution** +**How to start AxoContext's execution** ~~~SmallTalk PROGRAM MyProgram @@ -72,25 +72,25 @@ END_PROGRAM ~~~ -## IxObject +## AxoObject -IxObject is the base class for any other classes of ix.framework. It provides access to the parent IxObject and the IxContext in which it was initialized. +AxoObject is the base class for any other classes of ix.framework. It provides access to the parent AxoObject and the AxoContext in which it was initialized. ```mermaid classDiagram class Object{ - +Initialize(IIxContext context) - +Initialize(IIxObject parent) + +Initialize(IAxoContext context) + +Initialize(IAxoObject parent) } ``` -**IxObject initialization within a IxContext** +**AxoObject initialization within a AxoContext** ~~~SmallTalk - CLASS PUBLIC MyContext EXTENDS ix.core.IxContext + CLASS PUBLIC MyContext EXTENDS ix.core.AxoContext VAR - _myObject : ix.core.IxObject; + _myObject : ix.core.AxoObject; END_VAR METHOD PROTECTED OVERRIDE Main _myObject.Initialize(THIS); @@ -98,12 +98,12 @@ IxObject is the base class for any other classes of ix.framework. It provides ac END_CLASS ~~~ -**IxObject initialization within another IxObject** +**AxoObject initialization within another AxoObject** ~~~SmallTalk - CLASS PUBLIC MyParentObject EXTENDS ix.core.IxObject + CLASS PUBLIC MyParentObject EXTENDS ix.core.AxoObject VAR - _myChildObject : ix.core.IxObject; + _myChildObject : ix.core.AxoObject; END_VAR METHOD PROTECTED OVERRIDE Main _myChildObject.Initialize(THIS); @@ -111,16 +111,16 @@ IxObject is the base class for any other classes of ix.framework. It provides ac END_CLASS ~~~ -## IxTask +## AxoTask -IxTask provides basic task execution. IxTask needs to be initialized to set the proper IxContext. +AxoTask provides basic task execution. AxoTask needs to be initialized to set the proper AxoContext. -**IxTask initialization within a IxContext** +**AxoTask initialization within a AxoContext** ~~~SmallTalk - CLASS IxTaskExample EXTENDS IxContext + CLASS IxTaskExample EXTENDS AxoContext VAR PUBLIC - _myTask : IxTask; + _myTask : AxoTask; _myCounter : ULINT; END_VAR @@ -132,18 +132,18 @@ IxTask provides basic task execution. IxTask needs to be initialized to set the END_CLASS ~~~ -There are two key methods for managing the IxTask: +There are two key methods for managing the AxoTask: -- `Invoke()` fires the execution of the IxTask (can be called fire&forget or cyclically) -- `Execute()` method must be called cyclically. The method returns `TRUE` when the IxTask is required to run until enters `Done` state or terminates in error. +- `Invoke()` fires the execution of the AxoTask (can be called fire&forget or cyclically) +- `Execute()` method must be called cyclically. The method returns `TRUE` when the AxoTask is required to run until enters `Done` state or terminates in error. -For termination of the execution of the IxTask there are following methods: -- `DoneWhen(Done_Condition)` - terminates the execution of the IxTask and enters the `Done` state when the `Done_Condition` is `TRUE`. -- `ThrowWhen(Error_Condition)` - terminates the execution of the IxTask and enters the `Error` state when the `Error_Condition` is `TRUE`. -- `Abort()` - terminates the execution of the IxTask and enters the `Ready` state if the IxTask is in the `Busy` state, otherwise does nothing. +For termination of the execution of the AxoTask there are following methods: +- `DoneWhen(Done_Condition)` - terminates the execution of the AxoTask and enters the `Done` state when the `Done_Condition` is `TRUE`. +- `ThrowWhen(Error_Condition)` - terminates the execution of the AxoTask and enters the `Error` state when the `Error_Condition` is `TRUE`. +- `Abort()` - terminates the execution of the AxoTask and enters the `Ready` state if the AxoTask is in the `Busy` state, otherwise does nothing. -To reset the IxTask from any state in any moment there is following method: -- `Restore()` acts as reset of the IxTask (sets the state into `Ready` state from any state of the IxTask). +To reset the AxoTask from any state in any moment there is following method: +- `Restore()` acts as reset of the AxoTask (sets the state into `Ready` state from any state of the AxoTask). Moreover, there are seven more "event-like" methods that are called when a specific event occurs (see the chart below). @@ -211,11 +211,11 @@ flowchart TD end ``` -Example of using IxTask: +Example of using AxoTask: ~~~SmallTalk - CLASS IxTaskExample EXTENDS IxContext + CLASS IxTaskExample EXTENDS AxoContext VAR PUBLIC - _myTask : IxTask; + _myTask : AxoTask; _myCounter : ULINT; END_VAR @@ -235,21 +235,21 @@ Example of using IxTask: END_CLASS ~~~ -The IxTask executes upon the `Invoke` method call. `Invoke` fires the execution of `Execute` logic upon the first call, and it does not need cyclical calling. +The AxoTask executes upon the `Invoke` method call. `Invoke` fires the execution of `Execute` logic upon the first call, and it does not need cyclical calling. ~~~SmallTalk _myTask.Invoke(); ~~~ -`Invoke()` method returns IIxTaskState with the following members: +`Invoke()` method returns IAxoTaskState with the following members: - `IsBusy` indicates the execution started and is running. - `IsDone` indicates the execution completed with success. - `HasError` indicates the execution terminated with a failure. - - `IsAborted` indicates that the execution of the IxTask has been aborted. It should continue by calling the method `Resume()`. + - `IsAborted` indicates that the execution of the AxoTask has been aborted. It should continue by calling the method `Resume()`. ~~~SmallTalk - // Wait for IxTask to Complete + // Wait for AxoTask to Complete IF _myTask.Invoke().IsDone() THEN ; //Do something END_IF; @@ -261,29 +261,29 @@ The IxTask executes upon the `Invoke` method call. `Invoke` fires the execution ~~~ ~~~SmallTalk - // Make sure that the IxTask is executing + // Make sure that the AxoTask is executing IF _myTask.Invoke().IsBusy() THEN ; //Do something END_IF; ~~~ ~~~SmallTalk - // Check for IxTask's error + // Check for AxoTask's error IF _myTask.Invoke().HasError() THEN ; //Do something END_IF; ~~~ -The IxTask can be started only from the `Ready` state by calling the `Invoke()` method in the same Context cycle as the `Execute()` method is called, regardless the order of the methods calls. After IxTask completion, the state of the IxTask will remain in Done, unless: +The AxoTask can be started only from the `Ready` state by calling the `Invoke()` method in the same Context cycle as the `Execute()` method is called, regardless the order of the methods calls. After AxoTask completion, the state of the AxoTask will remain in Done, unless: -1.) IxTask's `Restore` method is called (IxTask changes it's state to `Ready` state). +1.) AxoTask's `Restore` method is called (AxoTask changes it's state to `Ready` state). 2.) `Invoke` method is not called for two or more consecutive cycles of its context (that usually means the same as PLC cycle); successive call of Invoke will switch the task into the Ready state and immediately into the `Kicking` state. -The IxTask may finish also in an `Error` state. In that case, the only possibility to get out of `Error` state is by calling the `Restore()` method. +The AxoTask may finish also in an `Error` state. In that case, the only possibility to get out of `Error` state is by calling the `Restore()` method. -To implement any of the already mentioned "event-like" methods the new class that extends from the IxTask needs to be created. The required method with `PROTECTED OVERRIDE` access modifier needs to be created as well, and the custom logic needs to be placed in. +To implement any of the already mentioned "event-like" methods the new class that extends from the AxoTask needs to be created. The required method with `PROTECTED OVERRIDE` access modifier needs to be created as well, and the custom logic needs to be placed in. These methods are: - `OnAbort()` - executes once when the task is aborted. - `OnResume()` - executes once when the task is resumed. @@ -336,56 +336,56 @@ Example of implementing "event-like" methods: ~~~ ## Step -IxStep is an extension class of the IxTask and provides the basics for the coordinated controlled execution of the task in the desired order based on the coordination mechanism used. +AxoStep is an extension class of the AxoTask and provides the basics for the coordinated controlled execution of the task in the desired order based on the coordination mechanism used. -IxStep contains the `Execute()` method so as its base class overloaded and extended by following parameters: +AxoStep contains the `Execute()` method so as its base class overloaded and extended by following parameters: -- coord (mandatory): instance of the coordination controlling the execution of the IxStep. -- Enable (optional): if this value is `FALSE`, IxStep body is not executed and the current order of the execution is incremented. -- Description (optional): IxStep description text describing the action the IxStep is providing. +- coord (mandatory): instance of the coordination controlling the execution of the AxoStep. +- Enable (optional): if this value is `FALSE`, AxoStep body is not executed and the current order of the execution is incremented. +- Description (optional): AxoStep description text describing the action the AxoStep is providing. -IxStep class contains following public members: +AxoStep class contains following public members: -- Order: Order of the IxStep in the coordination. This value can be set by calling the method `SetSteoOrder()` and read by the method `GetStepOrder()`. -- StepDescription: IxStep description text describing the action the IxStep is providing. This value can be set by calling the `Execute()` method with `Description` parameter. -- IsActive: if `TRUE`, the IxStep is currently executing, or is in the order of the execution, otherwise `FALSE`. This value can be set by calling the method `SetIsActive()` and read by the method `GetIsActive()`. -- IsEnabled: if `FALSE`, IxStep body is not executed and the current order of the execution is incremented. This value can be set by calling the method `SetIsEnabled()` or calling the `Execute()` method with `Enable` parameter and read by the method `GetIsEnabled()`. +- Order: Order of the AxoStep in the coordination. This value can be set by calling the method `SetSteoOrder()` and read by the method `GetStepOrder()`. +- StepDescription: AxoStep description text describing the action the AxoStep is providing. This value can be set by calling the `Execute()` method with `Description` parameter. +- IsActive: if `TRUE`, the AxoStep is currently executing, or is in the order of the execution, otherwise `FALSE`. This value can be set by calling the method `SetIsActive()` and read by the method `GetIsActive()`. +- IsEnabled: if `FALSE`, AxoStep body is not executed and the current order of the execution is incremented. This value can be set by calling the method `SetIsEnabled()` or calling the `Execute()` method with `Enable` parameter and read by the method `GetIsEnabled()`. -## IxSequencer +## AxoSequencer -IxSequencer is an IxCordinator class provides triggering the IxStep-s inside the sequence in the order they are written. +AxoSequencer is an IxCordinator class provides triggering the AxoStep-s inside the sequence in the order they are written. -IxSequencer extends from IxTask so it also has to be initialized by calling its `Initialize()` method and started using its `Invoke()` method. +AxoSequencer extends from AxoTask so it also has to be initialized by calling its `Initialize()` method and started using its `Invoke()` method. -IxSequencer contains following methods: -- `Open()`: this method must be called cyclically before any logic. It provides some configuration mechanism that ensures that the steps are going to be executed in the order, they are written. During the very first call of the sequence, no step is executed as the IxSequencer is in the configuring state. From the second context cycle after the IxSequencer has been invoked the IxSequencer change its state to running and starts the execution from the first step upto the last one. When IxSequencer is in running state, order of the step cannot be changed. -- `MoveNext()`: Terminates the currently executed step and moves the IxSequencer's pointer to the next step in order of execution. -- `RequestStep()`: Terminates the currently executed step and set the IxSequencer's pointer to the order of the `RequestedStep`. When the order of the `RequestedStep` is higher than the order of the currently finished step (the requested step is "after" the current one) the requested step is started in the same context cycle. When the order of the `RequestedStep` is lower than the order of the currently finished step (the requested step is "before" the current one) the requested step is started in the next context cycle. -- `CompleteSequence()`: Terminates the currently executed step, completes (finishes) the execution of this IxSequencer and set the coordination state to Idle. If the `SequenceMode` of the IxSequencer is set to `Cyclic`, following `Open()` method call in the next context cycle switch it again into the configuring state, reasign the order of the individual steps (even if the orders have been changed) and subsequently set IxSequencer back into the running state. If the `SequenceMode` of the IxSequencer is set to `RunOnce`, terminates also execution of the IxSequencer itself. -- `GetCoordinatorState()': Returns the current state of the IxSequencer. +AxoSequencer contains following methods: +- `Open()`: this method must be called cyclically before any logic. It provides some configuration mechanism that ensures that the steps are going to be executed in the order, they are written. During the very first call of the sequence, no step is executed as the AxoSequencer is in the configuring state. From the second context cycle after the AxoSequencer has been invoked the AxoSequencer change its state to running and starts the execution from the first step upto the last one. When AxoSequencer is in running state, order of the step cannot be changed. +- `MoveNext()`: Terminates the currently executed step and moves the AxoSequencer's pointer to the next step in order of execution. +- `RequestStep()`: Terminates the currently executed step and set the AxoSequencer's pointer to the order of the `RequestedStep`. When the order of the `RequestedStep` is higher than the order of the currently finished step (the requested step is "after" the current one) the requested step is started in the same context cycle. When the order of the `RequestedStep` is lower than the order of the currently finished step (the requested step is "before" the current one) the requested step is started in the next context cycle. +- `CompleteSequence()`: Terminates the currently executed step, completes (finishes) the execution of this AxoSequencer and set the coordination state to Idle. If the `SequenceMode` of the AxoSequencer is set to `Cyclic`, following `Open()` method call in the next context cycle switch it again into the configuring state, reasign the order of the individual steps (even if the orders have been changed) and subsequently set AxoSequencer back into the running state. If the `SequenceMode` of the AxoSequencer is set to `RunOnce`, terminates also execution of the AxoSequencer itself. +- `GetCoordinatorState()': Returns the current state of the AxoSequencer. - `Idle` - `Configuring`: assigning the orders to the steps, no step is executed. - `Running`: orders to the steps are already assigned, step is executed. -- `SetSteppingMode()`: Sets the stepping mode of the IxSequencer. Following values are possible. +- `SetSteppingMode()`: Sets the stepping mode of the AxoSequencer. Following values are possible. - `None`: - `StepByStep`: if this mode is choosen, each step needs to be started by the invocation of the `StepIn` commmand. - `Continous`: if this mode is choosen (default), each step is started automaticcaly after the previous one has been completed. -- `GetSteppingMode()`: Gets the current stepping mode of the IxSequencer. -- `SetSequenceMode()`: Sets the sequence mode of the IxSequencer. Following values are possible. +- `GetSteppingMode()`: Gets the current stepping mode of the AxoSequencer. +- `SetSequenceMode()`: Sets the sequence mode of the AxoSequencer. Following values are possible. - `None`: - `RunOnce`: if this mode is choosen, after calling the method `CompleteSequence()` the execution of the sequence is terminated. - `Cyclic`: if this mode is choosen (default), after calling the method `CompleteSequence()` the execution of the sequence is "reordered" and started from beginning. -- `GetSequenceMode()`: Gets the current sequence mode of the IxSequencer. +- `GetSequenceMode()`: Gets the current sequence mode of the AxoSequencer. - `GetNumberOfConfiguredSteps()`: Gets the number of the configured steps in the sequence. ~~~SmallTalk - CLASS IxSequencerExample EXTENDS IxContext + CLASS IxSequencerExample EXTENDS AxoContext VAR PUBLIC - _mySequencer : IxSequencer; - _step_1 : IxStep; - _step_2 : IxStep; - _step_3 : IxStep; + _mySequencer : AxoSequencer; + _step_1 : AxoStep; + _step_2 : AxoStep; + _step_3 : AxoStep; _myCounter : ULINT; END_VAR @@ -436,37 +436,37 @@ IxSequencer contains following methods: ~~~ -## IxComponent +## AxoComponent -`IxComponent` is an abstract class extending the IxObject, and it is the base building block for the "hardware-related devices" like a pneumatic piston, servo drive, robot, etc., so as for the, let's say, "virtual devices" like counter, database, etc. `IxComponent` is designed to group all possible methods, tasks, settings, and status information into one consistent class. As the `IxComponent` is an abstract class, it cannot be instantiated and must be extended. In the extended class, two methods are mandatory. +`AxoComponent` is an abstract class extending the AxoObject, and it is the base building block for the "hardware-related devices" like a pneumatic piston, servo drive, robot, etc., so as for the, let's say, "virtual devices" like counter, database, etc. `AxoComponent` is designed to group all possible methods, tasks, settings, and status information into one consistent class. As the `AxoComponent` is an abstract class, it cannot be instantiated and must be extended. In the extended class, two methods are mandatory. -`Restore()` - inside this method, the logic for resetting the IxComponent or restoring it from any state to its initial state should be placed. +`Restore()` - inside this method, the logic for resetting the AxoComponent or restoring it from any state to its initial state should be placed. -`ManualControl()` - inside this method, the logic for manual operations with the component should be placed. To be able to control the `IxComponent` instance manually, the method `ActivateManualControl()` of this instance needs to be called cyclically. +`ManualControl()` - inside this method, the logic for manual operations with the component should be placed. To be able to control the `AxoComponent` instance manually, the method `ActivateManualControl()` of this instance needs to be called cyclically. -The base class contains two additional method to deal with the manual control of the `IxComponent`. -`ActivateManualControl()` - when this method is called cyclically, the `IxComponent` changes its behavior to manually controllable and ensure the call of the `ManualControl()` method in the derived class. +The base class contains two additional method to deal with the manual control of the `AxoComponent`. +`ActivateManualControl()` - when this method is called cyclically, the `AxoComponent` changes its behavior to manually controllable and ensure the call of the `ManualControl()` method in the derived class. -`IsManuallyControllable()` -returns `TRUE` when the `IxComponent` is manually controllable. +`IsManuallyControllable()` -returns `TRUE` when the `AxoComponent` is manually controllable. **Layout attributes `ComponentHeader` and `ComponentDetails`** -The visual view of the extended `IxComponent` on the UI side could be done both ways. Manually with complete control over the design or by using the auto-rendering mechanism of the `RenderableContentControl` (TODO add a link to docu of the RenderableContentControl) element, which is, in most cases, more than perfect. +The visual view of the extended `AxoComponent` on the UI side could be done both ways. Manually with complete control over the design or by using the auto-rendering mechanism of the `RenderableContentControl` (TODO add a link to docu of the RenderableContentControl) element, which is, in most cases, more than perfect. To take full advantage of the auto-rendering mechanism, the base class has implemented the additional layout attributes `ComponentHeader` and `ComponentDetails(TabName)`. The auto-rendered view is divided into two parts: the fixed one and the expandable one. -All `IxComponent` members with the `ComponentHeader` layout attribute defined will be displayed in the fixed part. +All `AxoComponent` members with the `ComponentHeader` layout attribute defined will be displayed in the fixed part. All members with the `ComponentDetails(TabName)` layout attribute defined will be displayed in the expandable part inside the `TabControl` with "TabName". All members are added in the order in which they are defined, taking into account their layout attributes like `Container(Layout.Wrap)` or `Container(Layout.Stack)`. -**How to implement `IxComponent`** +**How to implement `AxoComponent`** -Example of the implementation very simple `IxComponent` with members placed only inside the Header. +Example of the implementation very simple `AxoComponent` with members placed only inside the Header. ~~~SmallTalk -using ix.framework.core; +using AXOpen.Core; {#ix-attr:[Container(Layout.Stack)]} {#ix-set:AttributeName = "Component with header only example"} -CLASS PUBLIC ComponentHeaderOnlyExample EXTENDS IxComponent - METHOD PROTECTED OVERRIDE Restore: IIxTask +CLASS PUBLIC ComponentHeaderOnlyExample EXTENDS AxoComponent + METHOD PROTECTED OVERRIDE Restore: IAxoTask // Some logic for Restore could be placed here. // For Example: valueReal := REAL#0.0; @@ -478,10 +478,10 @@ CLASS PUBLIC ComponentHeaderOnlyExample EXTENDS IxComponent ; END_METHOD - // Main method of the `IxComponent` that needs to be called inside the `IxContext` cyclically. + // Main method of the `AxoComponent` that needs to be called inside the `AxoContext` cyclically. METHOD PUBLIC Run // Declaration of the input and output variables. - // In the case of "hardware-related" `IxComponent`, + // In the case of "hardware-related" `AxoComponent`, // these would be the variables linked to the hardware. VAR_INPUT inReal : REAL; @@ -515,18 +515,18 @@ CLASS PUBLIC ComponentHeaderOnlyExample EXTENDS IxComponent END_CLASS ~~~ -**How to use `IxComponent`** +**How to use `AxoComponent`** -The instance of the extended `IxComponent` must be defined inside the `IxContext`. +The instance of the extended `AxoComponent` must be defined inside the `AxoContext`. ~~~SmallTalk -.....................EXTENDS ix.framework.core.IxContext +.....................EXTENDS AxoContext VAR PUBLIC {#ix-set:AttributeName = "Very simple component example with header only defined"} MyComponentWithHeaderOnly : ComponentHeaderOnlyExample; END_VAR ~~~ -Inside the `Main()` method of the related `IxContext` following rules must be applied. The `Initialize()` method of the extended instance of the `IxComponent` must be called first. +Inside the `Main()` method of the related `AxoContext` following rules must be applied. The `Initialize()` method of the extended instance of the `AxoComponent` must be called first. The `Run()` method with the respective input and output variables must be called afterwards. ~~~SmallTalk diff --git a/src/data/ctrl/apax.yml b/src/data/ctrl/apax.yml index ad509dffa..6256e4395 100644 --- a/src/data/ctrl/apax.yml +++ b/src/data/ctrl/apax.yml @@ -1,5 +1,5 @@ -name: "@ix-ax/ix.framework.data" -version : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' +name: "@ix-ax/axopen.data" +version : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' type: lib targets: # - "1500" @@ -9,7 +9,7 @@ targets: files: - src dependencies: - "@ix-ax/ix.framework.core" : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' + "@ix-ax/axopen.core" : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' devDependencies: "@ax/sdk": 3.0.8 diff --git a/src/data/ctrl/src/DataEntity.st b/src/data/ctrl/src/AxoDataEntity.st similarity index 71% rename from src/data/ctrl/src/DataEntity.st rename to src/data/ctrl/src/AxoDataEntity.st index 47250e0b3..50747f546 100644 --- a/src/data/ctrl/src/DataEntity.st +++ b/src/data/ctrl/src/AxoDataEntity.st @@ -1,5 +1,5 @@ -NAMESPACE ix.framework.data - CLASS DataEntity IMPLEMENTS IDataEntity +NAMESPACE AXOpen.Data + CLASS AxoDataEntity IMPLEMENTS IAxoDataEntity VAR PUBLIC {#ix-attr:[RenderIgnore("ShadowControl", "Control")]} DataEntityId : STRING[254]; diff --git a/src/data/ctrl/src/DataExchange.st b/src/data/ctrl/src/AxoDataExchange.st similarity index 76% rename from src/data/ctrl/src/DataExchange.st rename to src/data/ctrl/src/AxoDataExchange.st index 379418614..8ce2ab9f9 100644 --- a/src/data/ctrl/src/DataExchange.st +++ b/src/data/ctrl/src/AxoDataExchange.st @@ -1,16 +1,16 @@ -USING ix.framework.core; +USING AXOpen.Core; -NAMESPACE ix.framework.data - CLASS DataExchange EXTENDS IxObject IMPLEMENTS IDataExchange +NAMESPACE AXOpen.Data + CLASS AxoDataExchange EXTENDS AXOpen.Core.AxoObject IMPLEMENTS IAxoDataExchange VAR PUBLIC {#ix-set:AttributeName = "<#Create#>"} - CreateTask : DataExchangeTask; + CreateTask : AxoDataExchangeTask; {#ix-set:AttributeName = "<#Read#>"} - ReadTask : DataExchangeTask; + ReadTask : AxoDataExchangeTask; {#ix-set:AttributeName = "<#Update#>"} - UpdateTask : DataExchangeTask; + UpdateTask : AxoDataExchangeTask; {#ix-set:AttributeName = "<#Delete#>"} - DeleteTask : DataExchangeTask; + DeleteTask : AxoDataExchangeTask; END_VAR METHOD PRIVATE Run @@ -27,7 +27,7 @@ NAMESPACE ix.framework.data METHOD PUBLIC Run VAR_INPUT - Parent : IIxObject; + Parent : IAxoObject; END_VAR THIS.Initialize(Parent); THIS.Run(); @@ -35,34 +35,34 @@ NAMESPACE ix.framework.data METHOD PUBLIC Run VAR_INPUT - Context : IIxContext; + Context : IAxoContext; END_VAR THIS.Initialize(Context); THIS.Run(); END_METHOD - METHOD PUBLIC Create : IIxTaskState + METHOD PUBLIC Create : IAxoTaskState VAR_INPUT Identifier : STRING[254]; END_VAR Create := CreateTask.Invoke(Identifier); END_METHOD - METHOD PUBLIC Read : IIxTaskState + METHOD PUBLIC Read : IAxoTaskState VAR_INPUT Identifier : STRING[254]; END_VAR Read := ReadTask.Invoke(Identifier); END_METHOD - METHOD PUBLIC Update : IIxTaskState + METHOD PUBLIC Update : IAxoTaskState VAR_INPUT Identifier : STRING[254]; END_VAR Update := UpdateTask.Invoke(Identifier); END_METHOD - METHOD PUBLIC Delete : IIxTaskState + METHOD PUBLIC Delete : IAxoTaskState VAR_INPUT Identifier : STRING[254]; END_VAR diff --git a/src/data/ctrl/src/DataExchangeTask.st b/src/data/ctrl/src/AxoDataExchangeTask.st similarity index 64% rename from src/data/ctrl/src/DataExchangeTask.st rename to src/data/ctrl/src/AxoDataExchangeTask.st index e5cbf2a32..8fa88a0a4 100644 --- a/src/data/ctrl/src/DataExchangeTask.st +++ b/src/data/ctrl/src/AxoDataExchangeTask.st @@ -1,11 +1,11 @@ -USING ix.framework.core; -NAMESPACE ix.framework.data - CLASS DataExchangeTask EXTENDS ix.framework.core.IxRemoteTask +USING AXOpen.Core; +NAMESPACE AXOpen.Data + CLASS AxoDataExchangeTask EXTENDS AXOpen.Core.AxoRemoteTask VAR PUBLIC DataEntityIdentifier : STRING[254]; END_VAR - METHOD PUBLIC Invoke : ix.framework.core.IIxTaskState + METHOD PUBLIC Invoke : IAxoTaskState VAR_INPUT identifier : STRING[254]; END_VAR diff --git a/src/data/ctrl/src/IAxoDataEntity.st b/src/data/ctrl/src/IAxoDataEntity.st new file mode 100644 index 000000000..3ed226259 --- /dev/null +++ b/src/data/ctrl/src/IAxoDataEntity.st @@ -0,0 +1,5 @@ +NAMESPACE AXOpen.Data + INTERFACE IAxoDataEntity + + END_INTERFACE +END_NAMESPACE \ No newline at end of file diff --git a/src/data/ctrl/src/IDataExchange.st b/src/data/ctrl/src/IAxoDataExchange.st similarity index 70% rename from src/data/ctrl/src/IDataExchange.st rename to src/data/ctrl/src/IAxoDataExchange.st index 6787b90c3..09f839fc3 100644 --- a/src/data/ctrl/src/IDataExchange.st +++ b/src/data/ctrl/src/IAxoDataExchange.st @@ -1,26 +1,26 @@ -USING ix.framework.core; +USING AXOpen.Core; -NAMESPACE ix.framework.data - INTERFACE IDataExchange - METHOD Create : IIxTaskState +NAMESPACE AXOpen.Data + INTERFACE IAxoDataExchange + METHOD Create : IAxoTaskState VAR_INPUT Identifier : STRING[254]; END_VAR END_METHOD - METHOD Read : IIxTaskState + METHOD Read : IAxoTaskState VAR_INPUT Identifier : STRING[254]; END_VAR END_METHOD - METHOD Update : IIxTaskState + METHOD Update : IAxoTaskState VAR_INPUT Identifier : STRING[254]; END_VAR END_METHOD - METHOD Delete : IIxTaskState + METHOD Delete : IAxoTaskState VAR_INPUT Identifier : STRING[254]; END_VAR diff --git a/src/data/ctrl/src/IDataEntity.st b/src/data/ctrl/src/IDataEntity.st deleted file mode 100644 index fb90c2d83..000000000 --- a/src/data/ctrl/src/IDataEntity.st +++ /dev/null @@ -1,5 +0,0 @@ -NAMESPACE ix.framework.data - INTERFACE IDataEntity - - END_INTERFACE -END_NAMESPACE \ No newline at end of file diff --git a/src/data/ctrl/test/DataExchangeTaskTests.st b/src/data/ctrl/test/AxoDataExchangeTaskTests.st similarity index 78% rename from src/data/ctrl/test/DataExchangeTaskTests.st rename to src/data/ctrl/test/AxoDataExchangeTaskTests.st index ab6eb4733..496559567 100644 --- a/src/data/ctrl/test/DataExchangeTaskTests.st +++ b/src/data/ctrl/test/AxoDataExchangeTaskTests.st @@ -1,9 +1,10 @@ -USING ix.framework.core; -USING ix.framework.rtc; +USING AXOpen.Core; +USING AXOpen.Rtc; USING AxUnit; -NAMESPACE ix.framework.data - NAMESPACE DataExchangeTaskTests - CLASS TestContext IMPLEMENTS ix.framework.core.IIxContext + +NAMESPACE AXOpen.Data + NAMESPACE AxoDataExchangeTaskTests + CLASS TestContext IMPLEMENTS IAxoContext VAR PROTECTED _openCounter : ULINT; _closeCounter : ULINT; @@ -30,21 +31,21 @@ NAMESPACE ix.framework.data CreateIdentity := _identityCounter; END_METHOD - METHOD PUBLIC GetRtc : IRtc ; END_METHOD + METHOD PUBLIC GetRtc : IAxoRtc ; END_METHOD - METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IRtc; END_VAR ; END_METHOD + METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IAxoRtc; END_VAR ; END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment ; END_METHOD END_CLASS {TestFixture} - CLASS DataExchangeTask_Tests + CLASS AxoDataExchangeTask_Tests VAR PROTECTED _context : TestContext; - _dataExchangeTask : DataExchangeTask; + _dataExchangeTask : AxoDataExchangeTask; END_VAR {Test} diff --git a/src/data/ctrl/test/DataExchangeTests.st b/src/data/ctrl/test/AxoDataExchangeTests.st similarity index 87% rename from src/data/ctrl/test/DataExchangeTests.st rename to src/data/ctrl/test/AxoDataExchangeTests.st index 59b103210..74c5f65c8 100644 --- a/src/data/ctrl/test/DataExchangeTests.st +++ b/src/data/ctrl/test/AxoDataExchangeTests.st @@ -1,9 +1,10 @@ -USING ix.framework.core; -USING ix.framework.rtc; +USING AXOpen.Core; +USING AXOpen.Rtc; USING AxUnit; -NAMESPACE ix.framework.data - NAMESPACE DataExchangeTests - CLASS TestContext IMPLEMENTS ix.framework.core.IIxContext + +NAMESPACE AXOpen.Data + NAMESPACE AxoDataExchangeTests + CLASS TestContext IMPLEMENTS IAxoContext VAR PROTECTED _openCounter : ULINT; _closeCounter : ULINT; @@ -30,21 +31,21 @@ NAMESPACE ix.framework.data CreateIdentity := _identityCounter; END_METHOD - METHOD PUBLIC GetRtc : IRtc ; END_METHOD + METHOD PUBLIC GetRtc : IAxoRtc ; END_METHOD - METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IRtc; END_VAR ; END_METHOD + METHOD PUBLIC InjectRtc VAR_INPUT Rtc : IAxoRtc; END_VAR ; END_METHOD - METHOD PUBLIC Environment : IIxContextEnvironment + METHOD PUBLIC Environment : IAxoContextEnvironment ; END_METHOD END_CLASS {TestFixture} - CLASS DataExchange_Tests + CLASS AxoDataExchange_Tests VAR PROTECTED _context : TestContext; - _dataExchange : DataExchange; + _dataExchange : AxoDataExchange; END_VAR {Test} diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/ColumnData.razor b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/ColumnData.razor new file mode 100644 index 000000000..7c2f025c7 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/ColumnData.razor @@ -0,0 +1,26 @@ +@using AXOpen.Data; + + +@code { + [Parameter] + public string HeaderName { get; set; } + + [Parameter] + public string BindingValue { get; set; } + + [Parameter] + public bool Clickable { get; set; } = true; + + [CascadingParameter] + public AxoDataView DataView { get; set; } + + protected override void OnInitialized() + { + DataView.AddLine(this); + } + + public void Dispose() + { + DataView.RemoveLine(this); + } +} diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Command/AxoDataExchangeCommandView.razor b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Command/AxoDataExchangeCommandView.razor new file mode 100644 index 000000000..d7408d065 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Command/AxoDataExchangeCommandView.razor @@ -0,0 +1,7 @@ +@namespace AXOpen.Data +@inherits RenderableViewModelComponentBase + + + + + \ No newline at end of file diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Command/AxoDataExchangeCommandViewModel.cs b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Command/AxoDataExchangeCommandViewModel.cs new file mode 100644 index 000000000..07939a504 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Command/AxoDataExchangeCommandViewModel.cs @@ -0,0 +1,22 @@ +using ix.ax.core.blazor; +using AXOpen.Core.blazor.Toaster; +using AXOpen.Data.Interfaces; +using AXOpen.Data.ViewModels; +using AXOpen.Data; +using AXOpen.Base.Data; +using AXSharp.Presentation; +using Microsoft.AspNetCore.Components; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace AXOpen.Data +{ + public class AxoDataExchangeCommandViewModel : DataExchangeBaseViewModel + { + + } +} diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Status/AxoDataExchangeStatusView.razor b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Status/AxoDataExchangeStatusView.razor new file mode 100644 index 000000000..dc0f27920 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Status/AxoDataExchangeStatusView.razor @@ -0,0 +1,5 @@ +@namespace AXOpen.Data +@inherits RenderableViewModelComponentBase + + + diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Status/AxoDataExchangeStatusViewModel.cs b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Status/AxoDataExchangeStatusViewModel.cs new file mode 100644 index 000000000..51c720b21 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/Status/AxoDataExchangeStatusViewModel.cs @@ -0,0 +1,22 @@ +using ix.ax.core.blazor; +using AXOpen.Core.blazor.Toaster; +using AXOpen.Data.Interfaces; +using AXOpen.Data; +using AXOpen.Base.Data; +using AXSharp.Presentation; +using Microsoft.AspNetCore.Components; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using AXOpen.Data.ViewModels; + +namespace AXOpen.Data +{ + public class AxoDataExchangeStatusViewModel : DataExchangeBaseViewModel + { + + } +} diff --git a/src/data/src/AXOpen.Data.Blazor/DependencyInjection/ServiceConfiguration.cs b/src/data/src/AXOpen.Data.Blazor/DependencyInjection/ServiceConfiguration.cs new file mode 100644 index 000000000..1ccd6288f --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/DependencyInjection/ServiceConfiguration.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AXOpen.Data.DependencyInjection +{ + public static class ServicesConfiguration + { + public static void RegisterIxDataServices(this IServiceCollection services) + { + //services.AddScoped(); + + } + + + } +} diff --git a/src/data/src/ix.framework.data.blazor/ExampleJsInterop.cs b/src/data/src/AXOpen.Data.Blazor/ExampleJsInterop.cs similarity index 100% rename from src/data/src/ix.framework.data.blazor/ExampleJsInterop.cs rename to src/data/src/AXOpen.Data.Blazor/ExampleJsInterop.cs diff --git a/src/data/src/AXOpen.Data.Blazor/Interfaces/IDataViewModel.cs b/src/data/src/AXOpen.Data.Blazor/Interfaces/IDataViewModel.cs new file mode 100644 index 000000000..93f9ddfd3 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/Interfaces/IDataViewModel.cs @@ -0,0 +1,43 @@ +using AXOpen.Core.blazor.Toaster; +using AXOpen.Data; +using AXOpen.Base.Data; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AXOpen.Data.Interfaces +{ + public interface IDataViewModel + { + AxoDataExchange DataExchange { get; } + + ObservableCollection Records { get; set; } + IBrowsableDataObject SelectedRecord { get; set; } + Task FillObservableRecordsAsync(); + Task Filter(); + Task RefreshFilter(); + int Limit { get; set; } + string FilterById { get; set; } + eSearchMode SearchMode { get; set; } + long FilteredCount { get; set; } + int Page { get; set; } + string CreateItemId { get; set; } + + bool IsBusy { get; set; } + + Task CreateNew(); + void Delete(); + Task Copy(); + Task Edit(); + Task SendToPlc(); + Task LoadFromPlc(); + void ExportData(); + void ImportData(); + + event PropertyChangedEventHandler? PropertyChanged; + } +} diff --git a/src/data/src/ix.framework.data.blazor/Properties/AssemblyInfo.cs b/src/data/src/AXOpen.Data.Blazor/Properties/AssemblyInfo.cs similarity index 100% rename from src/data/src/ix.framework.data.blazor/Properties/AssemblyInfo.cs rename to src/data/src/AXOpen.Data.Blazor/Properties/AssemblyInfo.cs diff --git a/src/data/src/AXOpen.Data.Blazor/ViewModels/AxoDataViewModel.cs b/src/data/src/AXOpen.Data.Blazor/ViewModels/AxoDataViewModel.cs new file mode 100644 index 000000000..eb5ebf384 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/ViewModels/AxoDataViewModel.cs @@ -0,0 +1,278 @@ +// AXOpen.Data.blazor +// Copyright (c) 2023 Peter Kurhajec (PTKu), MTS, and Contributors. All Rights Reserved. +// Contributors: https://github.com/ix-ax/ix/graphs/contributors +// See the LICENSE file in the repository root for more information. +// https://github.com/ix-ax/ix/blob/master/LICENSE +// Third party licenses: https://github.com/ix-ax/ix/blob/master/notices.md + +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Messaging; +using AXOpen.Base.Data; +using AXSharp.Connector; +using AXOpen.Core.blazor.Toaster; +using AXOpen.Data; +using Microsoft.JSInterop; +using AXOpen.Core; +using AXOpen.Data.Interfaces; + +namespace AXOpen.Data.ViewModels; + +public partial class AxoDataViewModel : ObservableObject, IDataViewModel where T : IBrowsableDataObject, new() where O : class +{ + + public AxoDataViewModel(IRepository repository, AxoDataExchange dataExchange) : base() + { + + this.DataExchange = dataExchange; + DataBrowser = CreateBrowsable(repository); + Records = new ObservableCollection(); + _onlinerData = DataExchange.GetData(); + } + + private readonly O _onlinerData; + + public ITwinObject OnlineData => (ITwinObject)_onlinerData; + + public ICrudDataObject CrudData { get => (ICrudDataObject)_onlinerData; } + + private DataBrowser CreateBrowsable(IRepository repository) + { + return AXOpen.Base.Data.DataBrowser.Factory(repository); + } + + public DataBrowser DataBrowser { get; set; } + public AxoDataExchange DataExchange { get; } + + public List Changes { get; set; } + + private IBrowsableDataObject _selectedRecord; + + public IBrowsableDataObject SelectedRecord + { + get + { + return _selectedRecord; + } + + set + { + if (_selectedRecord == value) + { + return; + } + + CrudData.ChangeTracker.StopObservingChanges(); + _selectedRecord = value; + if (value != null) + { + OnlineData.PlainToShadow(value).Wait(); + CrudData.Changes = ((Pocos.AXOpen.Data.IAxoDataEntity)_selectedRecord).Changes; + Changes = CrudData.Changes; + } + + CrudData.ChangeTracker.StartObservingChanges(); + + } + } + + public Task FillObservableRecordsAsync() + { + //let another thread to load records, we need main thread to show loading symbol in blazor page + return Task.Run(async () => + { + IsBusy = true; + FillObservableRecords(); + IsBusy = false; + }); + } + + public void FillObservableRecords() + { + Records.Clear(); + DataBrowser.Filter(FilterById, Limit, Page * Limit, SearchMode); + + foreach (var item in DataBrowser.Records) + { + Records.Add(item); + } + FilteredCount = DataBrowser.FilteredCount(FilterById, SearchMode); + } + + public async Task Filter() + { + Page = 0; + await FillObservableRecordsAsync(); + } + + public async Task RefreshFilter() + { + Limit = 10; + FilterById = ""; + SearchMode = eSearchMode.Exact; + Page = 0; + await FillObservableRecordsAsync(); + } + + public async Task CreateNew() + { + var plainer = OnlineData.CreatePoco() as Pocos.AXOpen.Data.IAxoDataEntity; + + if (plainer == null) + throw new WrongTypeOfDataObjectException( + $"POCO object of 'DataExchange._data' member must be of {nameof(Pocos.AXOpen.Data.IAxoDataEntity)}"); + + if (CreateItemId != null) + plainer.DataEntityId = CreateItemId; + + try + { + DataBrowser.AddRecord((T)plainer); + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Success", "Created!", "Item was successfully created!", 10))); + } + catch (DuplicateIdException) + { + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Danger", "Duplicate ID!", "Item with the same ID already exists!", 10))); + } + + var plain = DataBrowser.FindById(plainer.DataEntityId); + await OnlineData.PlainToShadow(plain); + FillObservableRecords(); + CreateItemId = null; + } + + public void Delete() + { + var plainer = OnlineData.CreatePoco() as Pocos.AXOpen.Data.IAxoDataEntity; + + if (plainer == null) + throw new WrongTypeOfDataObjectException( + $"POCO object of 'DataExchange._data' member must be of {nameof(Pocos.AXOpen.Data.IAxoDataEntity)}"); + + plainer.DataEntityId = SelectedRecord.DataEntityId; + + DataBrowser.Delete((T)plainer); + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Success", "Deleted!", "Item was successfully deleted!", 10))); + FillObservableRecords(); + } + + public async Task Copy() + { + var plainer = await OnlineData.ShadowToPlain(); + + if (plainer == null) + throw new WrongTypeOfDataObjectException( + $"POCO object of 'DataExchange._data' member must be of {nameof(Pocos.AXOpen.Data.IAxoDataEntity)}"); + + if (CreateItemId != null) + { + plainer.DataEntityId = CreateItemId; + } + else + { + plainer.DataEntityId = $"Copy of {SelectedRecord.DataEntityId}"; + } + + try + { + DataBrowser.AddRecord((T)plainer); + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Success", "Copied!", "Item was successfully copied!", 10))); + } + catch (DuplicateIdException) + { + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Danger", "Duplicate ID!", "Item with the same ID already exists!", 10))); + } + var foundPlain = DataBrowser.FindById(plainer.DataEntityId); + await OnlineData.PlainToShadow(foundPlain); + FillObservableRecords(); + CreateItemId = null; + } + + public async Task Edit() + { + var plainer = await OnlineData.ShadowToPlain(); + CrudData.ChangeTracker.SaveObservedChanges(plainer); + DataBrowser.UpdateRecord(plainer); + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Success", "Edited!", "Item was successfully edited!", 10))); + FillObservableRecords(); + } + + public async Task SendToPlc() + { + await OnlineData.PlainToOnline(SelectedRecord); + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Success", "Sended to PLC!", "Item was successfully sended to PLC!", 10))); + } + + public async Task LoadFromPlc() + { + var plainer = await OnlineData.OnlineToPlain(); + + if (CreateItemId != null) + plainer.DataEntityId = CreateItemId; + + try + { + DataBrowser.AddRecord(plainer); + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Success", "Loaded from PLC!", "Item was successfully loaded from PLC!", 10))); + } + catch (DuplicateIdException) + { + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Danger", "Duplicate ID!", "Item with the same ID already exists!", 10))); + } + var plain = DataBrowser.FindById(plainer.DataEntityId); + await OnlineData.PlainToShadow(plain); + FillObservableRecords(); + CreateItemId = null; + } + + public void ExportData() + { + try + { + var exports = this.DataBrowser.Export(p => true); + + using (var sw = new StreamWriter("wwwroot/exportData.csv")) + { + foreach (var item in exports) + { + sw.Write(item + "\r"); + } + } + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Success", "Exported!", "Data was successfully exported!", 10))); + } + catch (Exception e) + { + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Danger", "Error!", e.Message, 10))); + } + } + + public void ImportData() + { + try + { + var imports = new List(); + foreach (var item in File.ReadAllLines("importData.csv")) + { + imports.Add(item); + } + + this.DataBrowser.Import(imports); + this.FillObservableRecords(); + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Success", "Imported!", "Data was successfully imported!", 10))); + } + catch (Exception e) + { + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Danger", "Error!", e.Message, 10))); + } + } + + public ObservableCollection Records { get; set; } + + public int Limit { get; set; } = 10; + public string FilterById { get; set; } = ""; + public eSearchMode SearchMode { get; set; } = eSearchMode.Exact; + public long FilteredCount { get; set; } + public int Page { get; set; } = 0; + public string CreateItemId { get; set; } + public bool IsBusy { get; set; } +} \ No newline at end of file diff --git a/src/data/src/AXOpen.Data.Blazor/ViewModels/AxoDataViewModelCreator.cs b/src/data/src/AXOpen.Data.Blazor/ViewModels/AxoDataViewModelCreator.cs new file mode 100644 index 000000000..f0bedcf59 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/ViewModels/AxoDataViewModelCreator.cs @@ -0,0 +1,26 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using AXOpen.Base.Data; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AXOpen.Data; +using System.Runtime.CompilerServices; +using Microsoft.AspNetCore.Components; +using System.Threading.Channels; + +namespace AXOpen.Data.ViewModels +{ + public class AxoDataViewModelCreator : ObservableObject + { + public static AxoDataViewModel Create(IRepository repository, AxoDataExchange dataExchange) where T : IBrowsableDataObject, new() + where O : class + { + return new AxoDataViewModel(repository, dataExchange); + + } + } +} diff --git a/src/data/src/AXOpen.Data.Blazor/ViewModels/DataExchangeBaseViewModel.cs b/src/data/src/AXOpen.Data.Blazor/ViewModels/DataExchangeBaseViewModel.cs new file mode 100644 index 000000000..4e858c461 --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/ViewModels/DataExchangeBaseViewModel.cs @@ -0,0 +1,95 @@ +using AXOpen.Data.Interfaces; +using AXOpen.Data; +using AXSharp.Presentation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace AXOpen.Data.ViewModels +{ + public class DataExchangeBaseViewModel : RenderableViewModelBase + { + public IDataViewModel DataViewModel + { + get; + private set; + } + public override object Model + { + get => this.DataViewModel.DataExchange; + set + { + CreateBrowsable((AxoDataExchange)value); + } + } + + + private void CreateBrowsable(AxoDataExchange dataExchangeObject) + { + try + { + var properties = dataExchangeObject.GetType().GetProperties(); + PropertyInfo? DataPropertyInfo = null; + + // iterate properties and look for DataEntityAttribute + foreach (var prop in properties) + { + var attr = prop.GetCustomAttribute(); + if (attr != null) + { + //if already set, that means multiple dataatributtes are present, we want to throw error + if(DataPropertyInfo != null) + { + throw new MultipleDataEntityAttributeException($"{dataExchangeObject.GetType().ToString()} contains multiple {nameof(DataEntityAttribute)}s! Make sure it contains only one."); + } + DataPropertyInfo = prop; + break; + } + } + + // if not found, throw exception + if (DataPropertyInfo == null) + { + throw new DataEntityAttributeNotFoundException($"{ dataExchangeObject.GetType().ToString()} must implement member, which inherits from {nameof(AxoDataEntity)} and is annotated with {nameof(DataEntityAttribute)}."); + } + + //// if is not sublass of DataEntity, throw exception + if (!DataPropertyInfo.PropertyType.IsSubclassOf(typeof(AxoDataEntity))) + { + throw new Exception($"Data object must inherits from DataEntity!"); + } + + + var dataOfType = DataPropertyInfo.PropertyType.Name; + var dataNameSpace = DataPropertyInfo.PropertyType.Namespace; + var dataAssembly = DataPropertyInfo.PropertyType.Assembly.ManifestModule.Name; + if (dataAssembly.LastIndexOf(".") >= 0) + dataAssembly = dataAssembly.Substring(0, dataAssembly.LastIndexOf(".")); + + + MethodInfo method = typeof(AxoDataViewModelCreator).GetMethod("Create"); + var genericTypeNamePoco = $"Pocos.{dataNameSpace}.{dataOfType}, {dataAssembly}"; + var genericTypePoco = Type.GetType(genericTypeNamePoco); + var genericTypeNameBase = $"{dataNameSpace}.{dataOfType}, {dataAssembly}"; + Type genericTypeBase = Type.GetType(genericTypeNameBase); + + if (genericTypePoco == null || genericTypeBase == null) + { + throw new Exception($"Could not retrieve {genericTypeNamePoco} or {genericTypeNameBase} when creating browsable object."); + } + + MethodInfo generic = method.MakeGenericMethod(genericTypePoco, genericTypeBase); + DataViewModel = (IDataViewModel)generic.Invoke(null, new object[] { dataExchangeObject.GetRepository(), dataExchangeObject }); + + } + catch + { + throw;//new BrowsableObjectCreationException("Unable to create browsable object for the view. For details see inner exception.", ex); + } + + } + } +} diff --git a/src/data/src/AXOpen.Data.Blazor/ViewModels/WrongTypeOfDataObjectException.cs b/src/data/src/AXOpen.Data.Blazor/ViewModels/WrongTypeOfDataObjectException.cs new file mode 100644 index 000000000..b204b2b4a --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/ViewModels/WrongTypeOfDataObjectException.cs @@ -0,0 +1,16 @@ +// AXOpen.Data.blazor +// Copyright (c) 2023 Peter Kurhajec (PTKu), MTS, and Contributors. All Rights Reserved. +// Contributors: https://github.com/ix-ax/ix/graphs/contributors +// See the LICENSE file in the repository root for more information. +// https://github.com/ix-ax/ix/blob/master/LICENSE +// Third party licenses: https://github.com/ix-ax/ix/blob/master/notices.md + +namespace AXOpen.Data.ViewModels; + +public class WrongTypeOfDataObjectException : Exception +{ + public WrongTypeOfDataObjectException(string message) : base(message) + { + + } +} \ No newline at end of file diff --git a/src/data/src/AXOpen.Data.Blazor/Views/AxoDataView.razor b/src/data/src/AXOpen.Data.Blazor/Views/AxoDataView.razor new file mode 100644 index 000000000..43ef9fd3e --- /dev/null +++ b/src/data/src/AXOpen.Data.Blazor/Views/AxoDataView.razor @@ -0,0 +1,502 @@ +@namespace AXOpen.Data +@using AXOpen.Data.Blazor.AxoDataExchange; +@using CommunityToolkit.Mvvm.ComponentModel; +@using CommunityToolkit.Mvvm.Messaging; +@using Microsoft.AspNetCore.Components.Forms; +@using AXOpen.Data.Interfaces; +@using AXOpen.Core.blazor.Toaster; +@using AXOpen.Core; +@using AXOpen.Data.ViewModels; + +

AxoDataView

+ +@if (Vm == null) +{ +
Loading...
+} +else +{ +
+
+ @if (Presentation.Equals("Command")) + { + + + @if (CanExport) + { + + + } + } +
+
+ + +
+
+ + +
+ +
+
+ + + + + + + @ChildContent + + @foreach (ColumnData column in Columns) + { + if (column.HeaderName is null || column.HeaderName == "") + { + + } + else + { + + } + } + + @if (Presentation.Equals("Command")) + { + + } + + + + @if (Vm.IsBusy) + { + + + + + + } + else if (!Vm.Records.Any()) + { + + + + + } + else + { + @foreach (var item in Vm.Records.ToList()) + { + + @if (ModalDataView) + { + + + @foreach (ColumnData column in Columns) + { + if (column.Clickable) + { + + } + else + { + + } + } + } + else + { + + + @foreach (ColumnData column in Columns) + { + if (column.Clickable) + { + + } + else + { + + } + } + } + + @if (Presentation.Equals("Command")) + { + + } + + } + } + + +
DataEntityId@column.BindingValue@column.HeaderNameActions
+
+ Loading... +
+
+

Collection is empty

+
@item.DataEntityId@(item.GetType().GetProperty(column.BindingValue)?.GetValue(item))@(item.GetType().GetProperty(column.BindingValue)?.GetValue(item))@item.DataEntityId@(item.GetType().GetProperty(column.BindingValue)?.GetValue(item))@(item.GetType().GetProperty(column.BindingValue)?.GetValue(item)) + + + +
+
+ + +
+
+ @if (!ModalDataView && Vm.SelectedRecord != null) + { +
+ + @if (Presentation.Equals("Command")) + { +
+ + + + +
+ } +
+ } + +} + + + + + + + + + + + + + + +@code { + + [Parameter] + public IDataViewModel Vm { get; set; } + + [Parameter] + public string Presentation { get; set; } + + [Parameter] + public bool ModalDataView { get; set; } = true; + + [Parameter] + public bool CanExport { get; set; } = false; + + [Parameter] + public RenderFragment ChildContent { get; set; } + + private readonly List Columns = new(); + + private Guid ViewGuid { get; } = new Guid(); + private string Create { get; set; } = ""; + + private bool isFileLoaded { get; set; } = false; + private bool isLoadingFile { get; set; } + + private int MaxPage { get { return (int)(Vm.FilteredCount % Vm.Limit == 0 ? Vm.FilteredCount / Vm.Limit - 1 : Vm.FilteredCount / Vm.Limit); } } + + public void AddLine(ColumnData line) + { + if (!Columns.Contains(line)) + { + Columns.Add(line); + StateHasChanged(); + } + } + + public void RemoveLine(ColumnData line) + { + if (Columns.Contains(line)) + { + Columns.Remove(line); + StateHasChanged(); + } + } + + private int mod(int x, int m) + { + int r = x % m; + return r < 0 ? r + m : r; + } + + private async Task setSearchModeAsync(AXOpen.Base.Data.eSearchMode searchMode) + { + Vm.SearchMode = searchMode; + + await Vm.FillObservableRecordsAsync(); + } + + private async Task setLimitAsync(int limit) + { + int oldLimit = Vm.Limit; + Vm.Limit = limit; + + Vm.Page = (Vm.Page * oldLimit) / Vm.Limit; + + await Vm.FillObservableRecordsAsync(); + } + + private async Task setPageAsync(int page) + { + Vm.Page = page; + + await Vm.FillObservableRecordsAsync(); + } + + protected override async Task OnInitializedAsync() + { + await Vm.FillObservableRecordsAsync(); + } + + private async Task LoadFile(InputFileChangeEventArgs e) + { + isLoadingFile = true; + isFileLoaded = false; + + try + { + await using FileStream fs = new("importData.csv", FileMode.Create); + await e.File.OpenReadStream().CopyToAsync(fs); + } + catch (Exception ex) + { + WeakReferenceMessenger.Default.Send(new ToastMessage(new Toast("Danger", "Error!", ex.Message, 10))); + } + + isLoadingFile = false; + isFileLoaded = true; + } +} diff --git a/src/data/src/ix.framework.data.blazor/_Imports.razor b/src/data/src/AXOpen.Data.Blazor/_Imports.razor similarity index 80% rename from src/data/src/ix.framework.data.blazor/_Imports.razor rename to src/data/src/AXOpen.Data.Blazor/_Imports.razor index 250ef234b..85025ea3e 100644 --- a/src/data/src/ix.framework.data.blazor/_Imports.razor +++ b/src/data/src/AXOpen.Data.Blazor/_Imports.razor @@ -1,4 +1,4 @@ @using Microsoft.AspNetCore.Components.Web @using AXSharp.Presentation.Blazor.Controls.RenderableContent @using CommunityToolkit.Mvvm.ComponentModel; -@using ix.framework.core.ViewModels; \ No newline at end of file +@using AXOpen.Data.ViewModels; \ No newline at end of file diff --git a/src/core/src/ix.framework.core.blazor/ix.framework.core.blazor.csproj b/src/data/src/AXOpen.Data.Blazor/axopen_data_blazor.csproj similarity index 66% rename from src/core/src/ix.framework.core.blazor/ix.framework.core.blazor.csproj rename to src/data/src/AXOpen.Data.Blazor/axopen_data_blazor.csproj index b7860c626..af210a51c 100644 --- a/src/core/src/ix.framework.core.blazor/ix.framework.core.blazor.csproj +++ b/src/data/src/AXOpen.Data.Blazor/axopen_data_blazor.csproj @@ -4,22 +4,19 @@ net7.0 enable enable - ix.framework.core + AXOpen.Data.Blazor + AXOpen.Data.Blazor - + + + + - - - - - - - - + @@ -33,13 +30,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + + diff --git a/src/data/src/ix.framework.data.blazor/package-lock.json b/src/data/src/AXOpen.Data.Blazor/package-lock.json similarity index 100% rename from src/data/src/ix.framework.data.blazor/package-lock.json rename to src/data/src/AXOpen.Data.Blazor/package-lock.json diff --git a/src/data/src/ix.framework.data.blazor/wwwroot/background.png b/src/data/src/AXOpen.Data.Blazor/wwwroot/background.png similarity index 100% rename from src/data/src/ix.framework.data.blazor/wwwroot/background.png rename to src/data/src/AXOpen.Data.Blazor/wwwroot/background.png diff --git a/src/data/src/ix.framework.data.blazor/wwwroot/exampleJsInterop.js b/src/data/src/AXOpen.Data.Blazor/wwwroot/exampleJsInterop.js similarity index 100% rename from src/data/src/ix.framework.data.blazor/wwwroot/exampleJsInterop.js rename to src/data/src/AXOpen.Data.Blazor/wwwroot/exampleJsInterop.js diff --git a/src/data/src/AXOpen.Data/ChangeTracker/ValueChangeItem.cs b/src/data/src/AXOpen.Data/ChangeTracker/ValueChangeItem.cs new file mode 100644 index 000000000..6c80cbf50 --- /dev/null +++ b/src/data/src/AXOpen.Data/ChangeTracker/ValueChangeItem.cs @@ -0,0 +1,13 @@ +using System; + +namespace AXOpen.Data +{ + public class ValueChangeItem + { + public DateTime DateTime { get; set; } + public string UserName { get; set; } + public ValueItemDescriptor ValueTag { get; set; } + public object OldValue { get; set; } + public object NewValue { get; set; } + } +} diff --git a/src/data/src/AXOpen.Data/ChangeTracker/ValueChangeTracker.cs b/src/data/src/AXOpen.Data/ChangeTracker/ValueChangeTracker.cs new file mode 100644 index 000000000..cb6e886e0 --- /dev/null +++ b/src/data/src/AXOpen.Data/ChangeTracker/ValueChangeTracker.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using AXOpen.Base.Data; +using AXOpen.Data; +using AXSharp.Connector; + +namespace AXOpen.Data +{ + public class ValueChangeTracker + { + private ITwinObject VortexObject { get; set; } + private ICrudDataObject DataObject { get; set; } + public ValueChangeTracker(ICrudDataObject dataObject) + { + VortexObject = (ITwinObject)dataObject; + DataObject = dataObject; + } + + public void StartObservingChanges() + { + Changes = new List(); + VortexObject.SubscribeShadowValueChange(LogShadowChanges); + } + + public void StopObservingChanges() + { + VortexObject.UnSubscribeShadowValueChange(); + } + + private void LogShadowChanges(ITwinPrimitive valueTag, object original, object newValue) + { + var userName = ""; + try + { + // TODO: determine current user name + } + catch + { + userName = "!failed to determine user!"; + } + + + Changes.Add(new ValueChangeItem() + { + ValueTag = new ValueItemDescriptor(valueTag), + OldValue = original, + NewValue = newValue, + DateTime = DateTime.Now, + UserName = userName + }); + } + + public void SaveObservedChanges(IBrowsableDataObject plainObject) + { + foreach (var change in Changes) + { + // TODO: Log value change + } + + if (DataObject.Changes == null) + { + DataObject.Changes = new List(); + } + + Changes.AddRange(DataObject.Changes); + ((Pocos.AXOpen.Data.IAxoDataEntity)plainObject).Changes.AddRange(Changes); + + Changes = new List(); + } + + private string GetUser() + { + var userName = "no user"; + + return userName; + } + + + public void Import(IBrowsableDataObject plainObject) + { + + var startImportTag = new ValueChangeItem() + { + DateTime = DateTime.Now, + UserName = GetUser(), + NewValue = "-Import start-", + OldValue = "-Import start-" + }; + + var endImportTag = new ValueChangeItem() + { + DateTime = DateTime.Now, + UserName = GetUser(), + NewValue = "-Import end-", + OldValue = "-Import end-" + }; + + ((Pocos.AXOpen.Data.IAxoDataEntity)plainObject).Changes.Add(startImportTag); + SaveObservedChanges(plainObject); + ((Pocos.AXOpen.Data.IAxoDataEntity)plainObject).Changes.Add(endImportTag); + + } + + + private List Changes = new List(); + } +} diff --git a/src/data/src/AXOpen.Data/ChangeTracker/ValueItemDescriptor.cs b/src/data/src/AXOpen.Data/ChangeTracker/ValueItemDescriptor.cs new file mode 100644 index 000000000..d9d72b0b0 --- /dev/null +++ b/src/data/src/AXOpen.Data/ChangeTracker/ValueItemDescriptor.cs @@ -0,0 +1,21 @@ +using AXSharp.Connector; + +namespace AXOpen.Data +{ + public class ValueItemDescriptor + { + + public ValueItemDescriptor() + { + + } + + public ValueItemDescriptor(ITwinPrimitive valueTag) + { + this.HumanReadable = valueTag.HumanReadable; + this.Symbol = valueTag.Symbol; + } + public string HumanReadable { get; set; } + public string Symbol { get; set; } + } +} diff --git a/src/data/src/AXOpen.Data/DataEntityAttribute.cs b/src/data/src/AXOpen.Data/DataEntityAttribute.cs new file mode 100644 index 000000000..179b9dcfe --- /dev/null +++ b/src/data/src/AXOpen.Data/DataEntityAttribute.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AXOpen.Data +{ + + [System.AttributeUsage(System.AttributeTargets.Property)] + public class DataEntityAttribute: Attribute + { + } +} diff --git a/src/data/src/AXOpen.Data/DataEntityAttributeNotFoundException.cs b/src/data/src/AXOpen.Data/DataEntityAttributeNotFoundException.cs new file mode 100644 index 000000000..285a2dd4f --- /dev/null +++ b/src/data/src/AXOpen.Data/DataEntityAttributeNotFoundException.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AXOpen.Data +{ + public class DataEntityAttributeNotFoundException : Exception + { + public DataEntityAttributeNotFoundException() + { + } + + public DataEntityAttributeNotFoundException(string message) + : base(message) + { + } + } +} diff --git a/src/data/src/AXOpen.Data/DataExchange/AxoDataExchange.cs b/src/data/src/AXOpen.Data/DataExchange/AxoDataExchange.cs new file mode 100644 index 000000000..465e38ffe --- /dev/null +++ b/src/data/src/AXOpen.Data/DataExchange/AxoDataExchange.cs @@ -0,0 +1,228 @@ +using System; +using System.Linq; +using AXOpen.Data; +using AXSharp.Connector; +using AXOpen.Base.Data; + + +namespace AXOpen.Data +{ + public partial class AxoDataExchange + { + /// An interaface which grants access to certain operations in DataExchange viewmodel, like searching by id, invoking search or filling the searchbox + public IDataExchangeOperations DataExchangeOperations { get; set; } + + private dynamic _onliner; + + public T GetData() where T : class + { + return (T)this.Onliner; + } + + public ITwinObject Data + { + get { return (ITwinObject)this.Onliner; } + } + + protected ICrudDataObject Onliner + { + get + { + if (this._onliner == null) + { + var dataProperty = this.GetType().GetProperties().ToList().Find(p => p.Name == "_data"); + + if (dataProperty == null) + { + dataProperty = this.GetType().GetProperty("_data", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + } + + if (dataProperty != null) + { + var exchangableObject = dataProperty.GetValue(this); + if (!(exchangableObject is AxoDataEntity || exchangableObject is IAxoDataEntity)) + { + throw new Exception($"Data exchange member '_data' in {this.Symbol} must inherit from {nameof(AxoDataEntity)}"); + } + + _onliner = exchangableObject; + } + else + { + throw new Exception($"Data exchange member '_data' is not member of {this.Symbol}. '_data' must inherit from {nameof(AxoDataEntity)}"); + } + } + + return this._onliner; + } + } + + private IRepository _repository; + + public IRepository GetRepository() where T : IBrowsableDataObject + => _repository as IRepository; + + public IRepository GetRepository() => _repository ?? + throw new RepositoryNotInitializedException($"Repository '{Symbol}' is not initialized. You must initialize repository by calling " + + $"'{nameof(InitializeRepository)}' method with respective parameters."); + + public void InitializeRepository(IRepository repository) + => _repository = repository; + + public void InitializeRepository(IRepository repository) where T : IBrowsableDataObject + => _repository = repository as IRepository; + + + public void InitializeRemoteDataExchange() + { + CreateTask.InitializeExclusively(Create); + ReadTask.InitializeExclusively(Read); + UpdateTask.InitializeExclusively(Update); + DeleteTask.InitializeExclusively(Delete); + this.WriteAsync().Wait(); + //_idExistsTask.InitializeExclusively(Exists); + //_createOrUpdateTask.Initialize(CreateOrUpdate); + } + + public void DeInitializeRemoteDataExchange() + { + CreateTask.DeInitialize(); + ReadTask.DeInitialize(); + UpdateTask.DeInitialize(); + DeleteTask.DeInitialize(); + this.WriteAsync().Wait(); + //_idExistsTask.InitializeExclusively(Exists); + //_createOrUpdateTask.Initialize(CreateOrUpdate); + } + + public void InitializeRemoteDataExchange(IRepository repository) where T : IBrowsableDataObject + { + this.InitializeRepository(repository); + this.InitializeRemoteDataExchange(); + } + + private bool Create() + { + CreateTask.ReadAsync().Wait(); + Onliner.DataEntityId.SetAsync(CreateTask.DataEntityIdentifier.LastValue).Wait(); + var cloned = this.Onliner.OnlineToPlainAsync().Result; + + try + { + _repository.Create(CreateTask.DataEntityIdentifier.LastValue, cloned); + return true; + } + catch (Exception exception) + { + throw exception; + } + } + + private bool CreateOrUpdate() + { + //_createOrUpdateTask.Read(); + //var id = _createOrUpdateTask._identifier.LastValue; + //Onliner._EntityId.Synchron = id; + //if (!this._repository.Exists(id)) + //{ + // var cloned = this.Onliner.CreatePlainerType(); + // this.Onliner.FlushOnlineToPlain(cloned); + // try + // { + // _repository.Create(id, cloned); + // return true; + // } + // catch (Exception exception) + // { + // throw exception; + // } + //} + //else + //{ + // var cloned = this.Onliner.CreatePlainerType(); + // this.Onliner.FlushOnlineToPlain(cloned); + // _repository.Update(id, cloned); + // return true; + //} + // + return true; + } + + + private bool Read() + { + ReadTask.ReadAsync().Wait(); + + try + { + object record = _repository.Read(ReadTask.DataEntityIdentifier.LastValue); + Onliner.PlainToOnlineAsync(record).Wait(); + return true; + } + catch (Exception exception) + { + throw exception; + } + } + private bool Update() + { + UpdateTask.ReadAsync().Wait(); + Onliner.DataEntityId.SetAsync(UpdateTask.DataEntityIdentifier.LastValue).Wait(); + var cloned = this.Onliner.OnlineToPlainAsync().Result; + try + { + _repository.Update(UpdateTask.DataEntityIdentifier.Cyclic, cloned); + return true; + } + catch (Exception exception) + { + throw exception; + } + } + + private bool Delete() + { + DeleteTask.ReadAsync().Wait(); + try + { + _repository.Delete(DeleteTask.DataEntityIdentifier.LastValue); + return true; + } + catch (Exception exception) + { + throw exception; + } + } + + private bool Exists() + { + //_idExistsTask.Read(); + //try + //{ + // _idExistsTask._exists.Synchron = _repository.Exists(_idExistsTask._identifier.Cyclic); + // return true; + //} + //catch (Exception exception) + //{ + // throw exception; + //} + return true; + } + + //private ITwinObject _onlinerVortex; + //protected ITwinObject OnlinerVortex + //{ + // get + // { + // if (_onlinerVortex == null) + // { + // _onlinerVortex = (ITwinObject)Onliner; + // } + + // return _onlinerVortex; + // } + //} + + + } +} diff --git a/src/data/src/AXOpen.Data/DataExchange/DataOnlinerExtensions.cs b/src/data/src/AXOpen.Data/DataExchange/DataOnlinerExtensions.cs new file mode 100644 index 000000000..210e22411 --- /dev/null +++ b/src/data/src/AXOpen.Data/DataExchange/DataOnlinerExtensions.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AXSharp.Connector; + +namespace AXOpen.Data +{ + public static class DataOnlinerExtensions + { + public static async Task PlainToShadowAsync(this ICrudDataObject twin, object plain) + { + return await ((dynamic)twin).PlainToShadowAsync(plain); + } + + public static async Task ShadowToPlainAsync(this ICrudDataObject twin, object plain) + { + return await ((dynamic)twin).PlainToShadowAsync(plain); + } + + + public static async Task OnlineToPlainAsync(this ICrudDataObject twin) + { + return await ((dynamic)twin).OnlineToPlainAsync(); + } + + public static async Task PlainToOnlineAsync(this ICrudDataObject twin, object plain) + { + return await ((dynamic)twin).PlainToOnlineAsync((dynamic)plain); + } + + + public static object CreateEmptyPoco(this ICrudDataObject twin) + { + return ((dynamic)twin).CreateEmptyPoco(); + } + } +} diff --git a/src/data/src/AXOpen.Data/Entity/AxoDataEntity.cs b/src/data/src/AXOpen.Data/Entity/AxoDataEntity.cs new file mode 100644 index 000000000..49208b28d --- /dev/null +++ b/src/data/src/AXOpen.Data/Entity/AxoDataEntity.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using AXSharp.Connector; +using AXOpen.Data; +using AXOpen.Base.Data; + +namespace AXOpen.Data +{ + public partial class AxoDataEntity : ICrudDataObject + { + public ValueChangeTracker ChangeTracker { get; private set; } + + partial void PostConstruct(ITwinObject parent, string readableTail, string symbolTail) + { + ChangeTracker = new ValueChangeTracker(this); + } + + public List Changes { get; set; } + } + +} diff --git a/src/data/src/AXOpen.Data/Entity/Pocos/AxoDataEntity.cs b/src/data/src/AXOpen.Data/Entity/Pocos/AxoDataEntity.cs new file mode 100644 index 000000000..d48591fd6 --- /dev/null +++ b/src/data/src/AXOpen.Data/Entity/Pocos/AxoDataEntity.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using AXOpen.Base.Data; +using AXOpen.Data; + +namespace Pocos.AXOpen.Data +{ + public partial class AxoDataEntity : IBrowsableDataObject, IAxoDataEntity + { + public dynamic RecordId { get; set; } + + List changes = new List(); + public List Changes + { + get + { + return changes; + } + set + { + changes = value; + } + } + } + +} diff --git a/src/data/src/AXOpen.Data/Entity/Pocos/IAxoDataEntity.cs b/src/data/src/AXOpen.Data/Entity/Pocos/IAxoDataEntity.cs new file mode 100644 index 000000000..8e861b2e9 --- /dev/null +++ b/src/data/src/AXOpen.Data/Entity/Pocos/IAxoDataEntity.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using AXOpen.Data; +using AXSharp.Connector; + +namespace Pocos.AXOpen.Data +{ + public partial interface IAxoDataEntity + { + public string DataEntityId { get; set; } + List Changes { get; set; } + } +} diff --git a/src/data/src/AXOpen.Data/ICrudDataObject.cs b/src/data/src/AXOpen.Data/ICrudDataObject.cs new file mode 100644 index 000000000..dc3806b26 --- /dev/null +++ b/src/data/src/AXOpen.Data/ICrudDataObject.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using AXSharp.Connector; +using AXSharp.Connector.ValueTypes; + +namespace AXOpen.Data +{ + public interface ICrudDataObject + { + OnlinerString DataEntityId { get; } + ValueChangeTracker ChangeTracker { get; } + List Changes { get; set; } + } +} diff --git a/src/data/src/AXOpen.Data/IDataExchangeOperations.cs b/src/data/src/AXOpen.Data/IDataExchangeOperations.cs new file mode 100644 index 000000000..5a2ced601 --- /dev/null +++ b/src/data/src/AXOpen.Data/IDataExchangeOperations.cs @@ -0,0 +1,13 @@ +namespace AXOpen.Data +{ + /// + /// An interaface which grants access to certain operations in DataExchange viewmodel, + /// like searching by id, invoking search or filling the searchbox + /// + public interface IDataExchangeOperations + { + object SelectedRecord { get; } + string FilterByID { get; set; } + void InvokeSearch(); + } +} \ No newline at end of file diff --git a/src/data/src/AXOpen.Data/MultipleDataEntityAttributeException.cs b/src/data/src/AXOpen.Data/MultipleDataEntityAttributeException.cs new file mode 100644 index 000000000..a870e52d7 --- /dev/null +++ b/src/data/src/AXOpen.Data/MultipleDataEntityAttributeException.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AXOpen.Data +{ + public class MultipleDataEntityAttributeException : Exception + { + + public MultipleDataEntityAttributeException() + { + } + + public MultipleDataEntityAttributeException(string message) + : base(message) + { + } + } +} diff --git a/src/data/src/AXOpen.Data/MultipleRemoteCallInitializationException.cs b/src/data/src/AXOpen.Data/MultipleRemoteCallInitializationException.cs new file mode 100644 index 000000000..58d505785 --- /dev/null +++ b/src/data/src/AXOpen.Data/MultipleRemoteCallInitializationException.cs @@ -0,0 +1,37 @@ +using System; +using System.Runtime.Serialization; + +namespace AXOpen.Data +{ + public class MultipleRemoteCallInitializationException : Exception + { + public MultipleRemoteCallInitializationException() + { + } + + /// Initializes a new instance of the class with serialized data. + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + /// The info parameter is null. + /// The class name is null or is zero (0). + protected MultipleRemoteCallInitializationException(SerializationInfo info, StreamingContext context) : base(info, context) + { + + } + + /// Initializes a new instance of the class with a specified error message. + /// The message that describes the error. + public MultipleRemoteCallInitializationException(string message) : base(message) + { + + } + + /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + public MultipleRemoteCallInitializationException(string message, Exception innerException) : base(message, innerException) + { + + } + } +} diff --git a/src/data/src/ix.framework.data/Usings.cs b/src/data/src/AXOpen.Data/Usings.cs similarity index 100% rename from src/data/src/ix.framework.data/Usings.cs rename to src/data/src/AXOpen.Data/Usings.cs diff --git a/src/data/src/AXOpen.Data/ix_ax_axopen_data.csproj b/src/data/src/AXOpen.Data/ix_ax_axopen_data.csproj new file mode 100644 index 000000000..8b701fd9e --- /dev/null +++ b/src/data/src/AXOpen.Data/ix_ax_axopen_data.csproj @@ -0,0 +1,36 @@ + + + net6.0;net7.0 + enable + enable + AXOpen.Data + AXOpen.Data + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/data/src/ix.framework.data.blazor/DependencyInjection/ServiceConfiguration.cs b/src/data/src/_ix.framework.data.blazor/DependencyInjection/ServiceConfiguration.cs similarity index 81% rename from src/data/src/ix.framework.data.blazor/DependencyInjection/ServiceConfiguration.cs rename to src/data/src/_ix.framework.data.blazor/DependencyInjection/ServiceConfiguration.cs index 22a6b648f..977b46b67 100644 --- a/src/data/src/ix.framework.data.blazor/DependencyInjection/ServiceConfiguration.cs +++ b/src/data/src/_ix.framework.data.blazor/DependencyInjection/ServiceConfiguration.cs @@ -1,4 +1,4 @@ -using ix.framework.core.ViewModels; +using AXOpen.Core.ViewModels; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; -namespace ix.framework.core.DependencyInjection +namespace AXOpen.Core.DependencyInjection { public static class ServicesConfiguration { diff --git a/src/data/src/_ix.framework.data.blazor/ExampleJsInterop.cs b/src/data/src/_ix.framework.data.blazor/ExampleJsInterop.cs new file mode 100644 index 000000000..a8f8b7b5d --- /dev/null +++ b/src/data/src/_ix.framework.data.blazor/ExampleJsInterop.cs @@ -0,0 +1,37 @@ +using Microsoft.JSInterop; + +namespace ix.ax.core.blazor +{ + // This class provides an example of how JavaScript functionality can be wrapped + // in a .NET class for easy consumption. The associated JavaScript module is + // loaded on demand when first needed. + // + // This class can be registered as scoped DI service and then injected into Blazor + // components for use. + + //public class ExampleJsInterop : IAsyncDisposable + //{ + // private readonly Lazy> moduleTask; + + // public ExampleJsInterop(IJSRuntime jsRuntime) + // { + // moduleTask = new(() => jsRuntime.InvokeAsync( + // "import", "./_content/ix.ax.core.blazor/exampleJsInterop.js").AsTask()); + // } + + // public async ValueTask Prompt(string message) + // { + // var module = await moduleTask.Value; + // return await module.InvokeAsync("showPrompt", message); + // } + + // public async ValueTask DisposeAsync() + // { + // if (moduleTask.IsValueCreated) + // { + // var module = await moduleTask.Value; + // await module.DisposeAsync(); + // } + // } + //} +} \ No newline at end of file diff --git a/src/data/src/ix.framework.data.blazor/Interfaces/IDataViewModel.cs b/src/data/src/_ix.framework.data.blazor/Interfaces/IDataViewModel.cs similarity index 90% rename from src/data/src/ix.framework.data.blazor/Interfaces/IDataViewModel.cs rename to src/data/src/_ix.framework.data.blazor/Interfaces/IDataViewModel.cs index c70ff1976..4d3f0c23e 100644 --- a/src/data/src/ix.framework.data.blazor/Interfaces/IDataViewModel.cs +++ b/src/data/src/_ix.framework.data.blazor/Interfaces/IDataViewModel.cs @@ -1,5 +1,5 @@ -using ix.framework.core.blazor.Toaster; -using ix.framework.core.ViewModels; +using AXOpen.Core.blazor.Toaster; +using AXOpen.Core.ViewModels; using ix.framework.data; using Ix.Base.Data; using System; @@ -10,7 +10,7 @@ using System.Text; using System.Threading.Tasks; -namespace ix.framework.core.Interfaces +namespace AXOpen.Core.Interfaces { public interface IDataViewModel { diff --git a/src/data/src/ix.framework.data.blazor/IxDataExchange/ColumnData.razor b/src/data/src/_ix.framework.data.blazor/IxDataExchange/ColumnData.razor similarity index 100% rename from src/data/src/ix.framework.data.blazor/IxDataExchange/ColumnData.razor rename to src/data/src/_ix.framework.data.blazor/IxDataExchange/ColumnData.razor diff --git a/src/data/src/_ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandView.razor b/src/data/src/_ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandView.razor new file mode 100644 index 000000000..1d2b18728 --- /dev/null +++ b/src/data/src/_ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandView.razor @@ -0,0 +1,7 @@ +@namespace ix.framework.data +@inherits RenderableViewModelComponentBase + + + + + \ No newline at end of file diff --git a/src/data/src/ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandViewModel.cs b/src/data/src/_ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandViewModel.cs similarity index 78% rename from src/data/src/ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandViewModel.cs rename to src/data/src/_ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandViewModel.cs index 7d15cd580..6cdc311e6 100644 --- a/src/data/src/ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandViewModel.cs +++ b/src/data/src/_ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandViewModel.cs @@ -1,7 +1,7 @@ using ix.ax.core.blazor; -using ix.framework.core.blazor.Toaster; -using ix.framework.core.Interfaces; -using ix.framework.core.ViewModels; +using AXOpen.Core.blazor.Toaster; +using AXOpen.Core.Interfaces; +using AXOpen.Core.ViewModels; using ix.framework.data; using Ix.Base.Data; using AXSharp.Presentation; diff --git a/src/data/src/ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusView.razor b/src/data/src/_ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusView.razor similarity index 100% rename from src/data/src/ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusView.razor rename to src/data/src/_ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusView.razor diff --git a/src/data/src/ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusViewModel.cs b/src/data/src/_ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusViewModel.cs similarity index 78% rename from src/data/src/ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusViewModel.cs rename to src/data/src/_ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusViewModel.cs index 65e226c7a..8e1e4d1f3 100644 --- a/src/data/src/ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusViewModel.cs +++ b/src/data/src/_ix.framework.data.blazor/IxDataExchange/Status/DataExchangeStatusViewModel.cs @@ -1,7 +1,7 @@ using ix.ax.core.blazor; -using ix.framework.core.blazor.Toaster; -using ix.framework.core.Interfaces; -using ix.framework.core.ViewModels; +using AXOpen.Core.blazor.Toaster; +using AXOpen.Core.Interfaces; +using AXOpen.Core.ViewModels; using ix.framework.data; using Ix.Base.Data; using AXSharp.Presentation; diff --git a/src/data/src/_ix.framework.data.blazor/Properties/AssemblyInfo.cs b/src/data/src/_ix.framework.data.blazor/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..7fc953296 --- /dev/null +++ b/src/data/src/_ix.framework.data.blazor/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using AXSharp.Presentation.Blazor.Attributes; + +[assembly: RenderableBlazorAssembly()] \ No newline at end of file diff --git a/src/data/src/ix.framework.data.blazor/ViewModels/DataExchangeBaseViewModel.cs b/src/data/src/_ix.framework.data.blazor/ViewModels/DataExchangeBaseViewModel.cs similarity index 97% rename from src/data/src/ix.framework.data.blazor/ViewModels/DataExchangeBaseViewModel.cs rename to src/data/src/_ix.framework.data.blazor/ViewModels/DataExchangeBaseViewModel.cs index 6f738a87e..7bda056df 100644 --- a/src/data/src/ix.framework.data.blazor/ViewModels/DataExchangeBaseViewModel.cs +++ b/src/data/src/_ix.framework.data.blazor/ViewModels/DataExchangeBaseViewModel.cs @@ -1,4 +1,4 @@ -using ix.framework.core.Interfaces; +using AXOpen.Core.Interfaces; using ix.framework.data; using AXSharp.Presentation; using System; @@ -8,7 +8,7 @@ using System.Text; using System.Threading.Tasks; -namespace ix.framework.core.ViewModels +namespace AXOpen.Core.ViewModels { public class DataExchangeBaseViewModel : RenderableViewModelBase { @@ -33,6 +33,7 @@ private void CreateBrowsable(DataExchange dataExchangeObject) { var properties = dataExchangeObject.GetType().GetProperties(); PropertyInfo? DataPropertyInfo = null; + // iterate properties and look for DataEntityAttribute foreach (var prop in properties) { @@ -45,6 +46,7 @@ private void CreateBrowsable(DataExchange dataExchangeObject) throw new MultipleDataEntityAttributeException($"{dataExchangeObject.GetType().ToString()} contains multiple {nameof(DataEntityAttribute)}s! Make sure it contains only one."); } DataPropertyInfo = prop; + break; } } diff --git a/src/data/src/ix.framework.data.blazor/ViewModels/IxDataViewModel.cs b/src/data/src/_ix.framework.data.blazor/ViewModels/IxDataViewModel.cs similarity index 98% rename from src/data/src/ix.framework.data.blazor/ViewModels/IxDataViewModel.cs rename to src/data/src/_ix.framework.data.blazor/ViewModels/IxDataViewModel.cs index 1f2e89ddc..12325f9d4 100644 --- a/src/data/src/ix.framework.data.blazor/ViewModels/IxDataViewModel.cs +++ b/src/data/src/_ix.framework.data.blazor/ViewModels/IxDataViewModel.cs @@ -10,12 +10,12 @@ using CommunityToolkit.Mvvm.Messaging; using Ix.Base.Data; using AXSharp.Connector; -using ix.framework.core.blazor.Toaster; -using ix.framework.core.Interfaces; +using AXOpen.Core.blazor.Toaster; +using AXOpen.Core.Interfaces; using ix.framework.data; using Microsoft.JSInterop; -namespace ix.framework.core.ViewModels; +namespace AXOpen.Core.ViewModels; public partial class IxDataViewModel : ObservableObject, IDataViewModel where T : IBrowsableDataObject, new() where O : class { diff --git a/src/data/src/ix.framework.data.blazor/ViewModels/IxDataViewModelCreator.cs b/src/data/src/_ix.framework.data.blazor/ViewModels/IxDataViewModelCreator.cs similarity index 94% rename from src/data/src/ix.framework.data.blazor/ViewModels/IxDataViewModelCreator.cs rename to src/data/src/_ix.framework.data.blazor/ViewModels/IxDataViewModelCreator.cs index 049d41a04..af812ae25 100644 --- a/src/data/src/ix.framework.data.blazor/ViewModels/IxDataViewModelCreator.cs +++ b/src/data/src/_ix.framework.data.blazor/ViewModels/IxDataViewModelCreator.cs @@ -12,7 +12,7 @@ using Microsoft.AspNetCore.Components; using System.Threading.Channels; -namespace ix.framework.core.ViewModels +namespace AXOpen.Core.ViewModels { public class IxDataViewModelCreator : ObservableObject { diff --git a/src/data/src/ix.framework.data.blazor/ViewModels/WrongTypeOfDataObjectException.cs b/src/data/src/_ix.framework.data.blazor/ViewModels/WrongTypeOfDataObjectException.cs similarity index 92% rename from src/data/src/ix.framework.data.blazor/ViewModels/WrongTypeOfDataObjectException.cs rename to src/data/src/_ix.framework.data.blazor/ViewModels/WrongTypeOfDataObjectException.cs index 0aad51c31..cc9dcf926 100644 --- a/src/data/src/ix.framework.data.blazor/ViewModels/WrongTypeOfDataObjectException.cs +++ b/src/data/src/_ix.framework.data.blazor/ViewModels/WrongTypeOfDataObjectException.cs @@ -5,7 +5,7 @@ // https://github.com/ix-ax/ix/blob/master/LICENSE // Third party licenses: https://github.com/ix-ax/ix/blob/master/notices.md -namespace ix.framework.core.ViewModels; +namespace AXOpen.Core.ViewModels; public class WrongTypeOfDataObjectException : Exception { diff --git a/src/data/src/ix.framework.data.blazor/Views/IxDataView.razor b/src/data/src/_ix.framework.data.blazor/Views/IxDataView.razor similarity index 98% rename from src/data/src/ix.framework.data.blazor/Views/IxDataView.razor rename to src/data/src/_ix.framework.data.blazor/Views/IxDataView.razor index 80ab5bf33..3243f7752 100644 --- a/src/data/src/ix.framework.data.blazor/Views/IxDataView.razor +++ b/src/data/src/_ix.framework.data.blazor/Views/IxDataView.razor @@ -2,11 +2,11 @@ @using CommunityToolkit.Mvvm.ComponentModel; @using CommunityToolkit.Mvvm.Messaging; @using Microsoft.AspNetCore.Components.Forms; -@using ix.framework.core.Interfaces; -@using ix.framework.core.IxDataExchange; -@using ix.framework.core.ViewModels; -@using ix.framework.core.blazor.Toaster; -@using ix.framework.core; +@using AXOpen.Core.Interfaces; +@using AXOpen.Core.IxDataExchange; +@using AXOpen.Core.ViewModels; +@using AXOpen.Core.blazor.Toaster; +@using AXOpen.Core;

IxDataView

@@ -101,8 +101,8 @@ else { @foreach (var item in Vm.Records.ToList()) { - - @if (ModalDetailView) + + @if (ModalDataView) { @item.DataEntityId @@ -221,7 +221,7 @@ else - @if (!ModalDetailView && Vm.SelectedRecord != null) + @if (!ModalDataView && Vm.SelectedRecord != null) {
@@ -409,7 +409,7 @@ else public string Presentation { get; set; } [Parameter] - public bool ModalDetailView { get; set; } = true; + public bool ModalDataView { get; set; } = true; [Parameter] public bool CanExport { get; set; } = false; diff --git a/src/data/src/_ix.framework.data.blazor/_Imports.razor b/src/data/src/_ix.framework.data.blazor/_Imports.razor new file mode 100644 index 000000000..6618afe08 --- /dev/null +++ b/src/data/src/_ix.framework.data.blazor/_Imports.razor @@ -0,0 +1,4 @@ +@using Microsoft.AspNetCore.Components.Web +@using AXSharp.Presentation.Blazor.Controls.RenderableContent +@using CommunityToolkit.Mvvm.ComponentModel; +@using AXOpen.Core.ViewModels; \ No newline at end of file diff --git a/src/data/src/ix.framework.data.blazor/ix.framework.data.blazor.csproj b/src/data/src/_ix.framework.data.blazor/ix.framework.data.blazor.csproj similarity index 85% rename from src/data/src/ix.framework.data.blazor/ix.framework.data.blazor.csproj rename to src/data/src/_ix.framework.data.blazor/ix.framework.data.blazor.csproj index be3abc2e9..4e6f1e11e 100644 --- a/src/data/src/ix.framework.data.blazor/ix.framework.data.blazor.csproj +++ b/src/data/src/_ix.framework.data.blazor/ix.framework.data.blazor.csproj @@ -4,7 +4,7 @@ net7.0 enable enable - ix.framework.core + AXOpen.Core @@ -29,13 +29,13 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/src/data/src/_ix.framework.data.blazor/package-lock.json b/src/data/src/_ix.framework.data.blazor/package-lock.json new file mode 100644 index 000000000..a1067c7ca --- /dev/null +++ b/src/data/src/_ix.framework.data.blazor/package-lock.json @@ -0,0 +1,11 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "bootstrap-icons": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.10.3.tgz", + "integrity": "sha512-7Qvj0j0idEm/DdX9Q0CpxAnJYqBCFCiUI6qzSPYfERMcokVuV9Mdm/AJiVZI8+Gawe4h/l6zFcOzvV7oXCZArw==" + } + } +} diff --git a/src/data/src/_ix.framework.data.blazor/wwwroot/background.png b/src/data/src/_ix.framework.data.blazor/wwwroot/background.png new file mode 100644 index 000000000..e15a3bde6 Binary files /dev/null and b/src/data/src/_ix.framework.data.blazor/wwwroot/background.png differ diff --git a/src/data/src/_ix.framework.data.blazor/wwwroot/exampleJsInterop.js b/src/data/src/_ix.framework.data.blazor/wwwroot/exampleJsInterop.js new file mode 100644 index 000000000..ea8d76ad2 --- /dev/null +++ b/src/data/src/_ix.framework.data.blazor/wwwroot/exampleJsInterop.js @@ -0,0 +1,6 @@ +// This is a JavaScript module that is loaded on demand. It can export any number of +// functions, and may import other JavaScript modules if required. + +export function showPrompt(message) { + return prompt(message, 'Type anything here'); +} diff --git a/src/data/src/ix.framework.data/ChangeTracker/ValueChangeItem.cs b/src/data/src/_ix.framework.data/ChangeTracker/ValueChangeItem.cs similarity index 100% rename from src/data/src/ix.framework.data/ChangeTracker/ValueChangeItem.cs rename to src/data/src/_ix.framework.data/ChangeTracker/ValueChangeItem.cs diff --git a/src/data/src/ix.framework.data/ChangeTracker/ValueChangeTracker.cs b/src/data/src/_ix.framework.data/ChangeTracker/ValueChangeTracker.cs similarity index 100% rename from src/data/src/ix.framework.data/ChangeTracker/ValueChangeTracker.cs rename to src/data/src/_ix.framework.data/ChangeTracker/ValueChangeTracker.cs diff --git a/src/data/src/ix.framework.data/ChangeTracker/ValueItemDescriptor.cs b/src/data/src/_ix.framework.data/ChangeTracker/ValueItemDescriptor.cs similarity index 100% rename from src/data/src/ix.framework.data/ChangeTracker/ValueItemDescriptor.cs rename to src/data/src/_ix.framework.data/ChangeTracker/ValueItemDescriptor.cs diff --git a/src/data/src/ix.framework.data/DataEntityAttribute.cs b/src/data/src/_ix.framework.data/DataEntityAttribute.cs similarity index 100% rename from src/data/src/ix.framework.data/DataEntityAttribute.cs rename to src/data/src/_ix.framework.data/DataEntityAttribute.cs diff --git a/src/data/src/ix.framework.data/DataEntityAttributeNotFoundException.cs b/src/data/src/_ix.framework.data/DataEntityAttributeNotFoundException.cs similarity index 100% rename from src/data/src/ix.framework.data/DataEntityAttributeNotFoundException.cs rename to src/data/src/_ix.framework.data/DataEntityAttributeNotFoundException.cs diff --git a/src/data/src/ix.framework.data/DataExchange/DataExchange.cs b/src/data/src/_ix.framework.data/DataExchange/DataExchange.cs similarity index 100% rename from src/data/src/ix.framework.data/DataExchange/DataExchange.cs rename to src/data/src/_ix.framework.data/DataExchange/DataExchange.cs diff --git a/src/data/src/ix.framework.data/DataExchange/DataOnlinerExtensions.cs b/src/data/src/_ix.framework.data/DataExchange/DataOnlinerExtensions.cs similarity index 100% rename from src/data/src/ix.framework.data/DataExchange/DataOnlinerExtensions.cs rename to src/data/src/_ix.framework.data/DataExchange/DataOnlinerExtensions.cs diff --git a/src/data/src/ix.framework.data/Entity/DataEntity.cs b/src/data/src/_ix.framework.data/Entity/DataEntity.cs similarity index 100% rename from src/data/src/ix.framework.data/Entity/DataEntity.cs rename to src/data/src/_ix.framework.data/Entity/DataEntity.cs diff --git a/src/data/src/ix.framework.data/Entity/Pocos/DataEntity.cs b/src/data/src/_ix.framework.data/Entity/Pocos/DataEntity.cs similarity index 100% rename from src/data/src/ix.framework.data/Entity/Pocos/DataEntity.cs rename to src/data/src/_ix.framework.data/Entity/Pocos/DataEntity.cs diff --git a/src/data/src/ix.framework.data/Entity/Pocos/IDataEntity.cs b/src/data/src/_ix.framework.data/Entity/Pocos/IDataEntity.cs similarity index 100% rename from src/data/src/ix.framework.data/Entity/Pocos/IDataEntity.cs rename to src/data/src/_ix.framework.data/Entity/Pocos/IDataEntity.cs diff --git a/src/data/src/ix.framework.data/ICrudDataObject.cs b/src/data/src/_ix.framework.data/ICrudDataObject.cs similarity index 100% rename from src/data/src/ix.framework.data/ICrudDataObject.cs rename to src/data/src/_ix.framework.data/ICrudDataObject.cs diff --git a/src/data/src/ix.framework.data/IDataExchangeOperations.cs b/src/data/src/_ix.framework.data/IDataExchangeOperations.cs similarity index 100% rename from src/data/src/ix.framework.data/IDataExchangeOperations.cs rename to src/data/src/_ix.framework.data/IDataExchangeOperations.cs diff --git a/src/data/src/ix.framework.data/MultipleDataEntityAttributeException.cs b/src/data/src/_ix.framework.data/MultipleDataEntityAttributeException.cs similarity index 100% rename from src/data/src/ix.framework.data/MultipleDataEntityAttributeException.cs rename to src/data/src/_ix.framework.data/MultipleDataEntityAttributeException.cs diff --git a/src/data/src/ix.framework.data/MultipleRemoteCallInitializationException.cs b/src/data/src/_ix.framework.data/MultipleRemoteCallInitializationException.cs similarity index 100% rename from src/data/src/ix.framework.data/MultipleRemoteCallInitializationException.cs rename to src/data/src/_ix.framework.data/MultipleRemoteCallInitializationException.cs diff --git a/src/data/src/_ix.framework.data/Usings.cs b/src/data/src/_ix.framework.data/Usings.cs new file mode 100644 index 000000000..181fdd64e --- /dev/null +++ b/src/data/src/_ix.framework.data/Usings.cs @@ -0,0 +1 @@ +global using System.Threading.Tasks; \ No newline at end of file diff --git a/src/data/src/ix.framework.data/ix_ax_ix_framework_data.csproj b/src/data/src/_ix.framework.data/ix_ax_ix_framework_data.csproj similarity index 73% rename from src/data/src/ix.framework.data/ix_ax_ix_framework_data.csproj rename to src/data/src/_ix.framework.data/ix_ax_ix_framework_data.csproj index e14cc0260..609822cb3 100644 --- a/src/data/src/ix.framework.data/ix_ax_ix_framework_data.csproj +++ b/src/data/src/_ix.framework.data/ix_ax_ix_framework_data.csproj @@ -3,8 +3,8 @@ net6.0;net7.0 enable enable - ix.framework.data - ix.framework.data + AXOpen.Data + AXOpen.Data @@ -12,8 +12,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + @@ -26,8 +26,11 @@ + + - + + \ No newline at end of file diff --git a/src/data/src/ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandView.razor b/src/data/src/ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandView.razor deleted file mode 100644 index 18c23b937..000000000 --- a/src/data/src/ix.framework.data.blazor/IxDataExchange/Command/DataExchangeCommandView.razor +++ /dev/null @@ -1,4 +0,0 @@ -@namespace ix.framework.data -@inherits RenderableViewModelComponentBase - - \ No newline at end of file diff --git a/src/data/src/repositories/InMemory/Ix.Framework.Data.InMemory.csproj b/src/data/src/repositories/InMemory/AXOpen.Data.InMemory.csproj similarity index 79% rename from src/data/src/repositories/InMemory/Ix.Framework.Data.InMemory.csproj rename to src/data/src/repositories/InMemory/AXOpen.Data.InMemory.csproj index 66df02905..69f995c1d 100644 --- a/src/data/src/repositories/InMemory/Ix.Framework.Data.InMemory.csproj +++ b/src/data/src/repositories/InMemory/AXOpen.Data.InMemory.csproj @@ -8,7 +8,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/src/data/src/repositories/InMemory/InMemory/InMemoryRepository.cs b/src/data/src/repositories/InMemory/InMemory/InMemoryRepository.cs index 3c34ea7d1..26a88be6e 100644 --- a/src/data/src/repositories/InMemory/InMemory/InMemoryRepository.cs +++ b/src/data/src/repositories/InMemory/InMemory/InMemoryRepository.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Ix.Base.Data; +using AXOpen.Base.Data; -namespace Ix.Framework.Data.InMemory +namespace AXOpen.Data.InMemory { /// /// Provides in memory data repository. diff --git a/src/data/src/repositories/InMemory/InMemory/InMemoryRepositorySettings.cs b/src/data/src/repositories/InMemory/InMemory/InMemoryRepositorySettings.cs index 92f07f955..1ff83b680 100644 --- a/src/data/src/repositories/InMemory/InMemory/InMemoryRepositorySettings.cs +++ b/src/data/src/repositories/InMemory/InMemory/InMemoryRepositorySettings.cs @@ -1,7 +1,7 @@ -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; -namespace Ix.Framework.Data.InMemory +namespace AXOpen.Data.InMemory { /// diff --git a/src/data/src/repositories/InMemory/InMemory/SameObjectReferenceException.cs b/src/data/src/repositories/InMemory/InMemory/SameObjectReferenceException.cs index 0e901993a..a438663cd 100644 --- a/src/data/src/repositories/InMemory/InMemory/SameObjectReferenceException.cs +++ b/src/data/src/repositories/InMemory/InMemory/SameObjectReferenceException.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.Serialization; -namespace Ix.Framework.Data.InMemory +namespace AXOpen.Data.InMemory { public class SameObjectReferenceException : Exception { diff --git a/src/data/src/repositories/InMemory/RepositoryExtensions.cs b/src/data/src/repositories/InMemory/RepositoryExtensions.cs index 31fee16ad..dcb9e2a3c 100644 --- a/src/data/src/repositories/InMemory/RepositoryExtensions.cs +++ b/src/data/src/repositories/InMemory/RepositoryExtensions.cs @@ -1,7 +1,7 @@ -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; -namespace Ix.Framework.Data.InMemory +namespace AXOpen.Data.InMemory { public static class Repository { diff --git a/src/data/src/repositories/Json/Ix.Framework.Data.Json.csproj b/src/data/src/repositories/Json/AXOpen.Data.Json.csproj similarity index 79% rename from src/data/src/repositories/Json/Ix.Framework.Data.Json.csproj rename to src/data/src/repositories/Json/AXOpen.Data.Json.csproj index 25373bbd5..c3cff3353 100644 --- a/src/data/src/repositories/Json/Ix.Framework.Data.Json.csproj +++ b/src/data/src/repositories/Json/AXOpen.Data.Json.csproj @@ -8,7 +8,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/src/data/src/repositories/Json/Json/JsonRepository.cs b/src/data/src/repositories/Json/Json/JsonRepository.cs index 5c8d140be..bef4b13c6 100644 --- a/src/data/src/repositories/Json/Json/JsonRepository.cs +++ b/src/data/src/repositories/Json/Json/JsonRepository.cs @@ -2,11 +2,11 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; -namespace Ix.Framework.Data.Json +namespace AXOpen.Data.Json { /// /// Provides repository for storing data in files with `Json` format. diff --git a/src/data/src/repositories/Json/Json/JsonRepositoryParameters.cs b/src/data/src/repositories/Json/Json/JsonRepositoryParameters.cs index 2479e6dce..9d615ee39 100644 --- a/src/data/src/repositories/Json/Json/JsonRepositoryParameters.cs +++ b/src/data/src/repositories/Json/Json/JsonRepositoryParameters.cs @@ -1,7 +1,7 @@ -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; -namespace Ix.Framework.Data.Json +namespace AXOpen.Data.Json { /// /// Provides parameter diff --git a/src/data/src/repositories/Json/RepositoryExtensions.cs b/src/data/src/repositories/Json/RepositoryExtensions.cs index 90409a546..69f4e6e6c 100644 --- a/src/data/src/repositories/Json/RepositoryExtensions.cs +++ b/src/data/src/repositories/Json/RepositoryExtensions.cs @@ -1,7 +1,7 @@ using System; -using Ix.Base.Data; -using Ix.Framework.Data; -using Ix.Framework.Data.Json; +using AXOpen.Base.Data; +using AXOpen.Data; +using AXOpen.Data.Json; namespace Ix.Repository.Json { diff --git a/src/data/src/repositories/MongoDb/Ix.Framework.Data.MongoDb.csproj b/src/data/src/repositories/MongoDb/AXOpen.Data.MongoDb.csproj similarity index 80% rename from src/data/src/repositories/MongoDb/Ix.Framework.Data.MongoDb.csproj rename to src/data/src/repositories/MongoDb/AXOpen.Data.MongoDb.csproj index a29f3e01d..182fa2864 100644 --- a/src/data/src/repositories/MongoDb/Ix.Framework.Data.MongoDb.csproj +++ b/src/data/src/repositories/MongoDb/AXOpen.Data.MongoDb.csproj @@ -1,4 +1,4 @@ - + Library net6.0;net7.0 @@ -11,7 +11,6 @@ - - + diff --git a/src/data/src/repositories/MongoDb/Mongo/FloatTruncationSerializer.cs b/src/data/src/repositories/MongoDb/Mongo/FloatTruncationSerializer.cs index 887e6bc42..60580ed40 100644 --- a/src/data/src/repositories/MongoDb/Mongo/FloatTruncationSerializer.cs +++ b/src/data/src/repositories/MongoDb/Mongo/FloatTruncationSerializer.cs @@ -2,7 +2,7 @@ using MongoDB.Bson.Serialization.Serializers; using System; -namespace Ix.Framework.Data.MongoDb +namespace AXOpen.Data.MongoDb { /// /// Writes the float value to mongo as double as reads it back as float. diff --git a/src/data/src/repositories/MongoDb/Mongo/MongoDbCredentials.cs b/src/data/src/repositories/MongoDb/Mongo/MongoDbCredentials.cs index 5d514d460..fe7fcc2a2 100644 --- a/src/data/src/repositories/MongoDb/Mongo/MongoDbCredentials.cs +++ b/src/data/src/repositories/MongoDb/Mongo/MongoDbCredentials.cs @@ -1,4 +1,4 @@ -namespace Ix.Framework.Data.MongoDb +namespace AXOpen.Data.MongoDb { /// /// To use MongoDbCrendetials you must at first create a database with users diff --git a/src/data/src/repositories/MongoDb/Mongo/MongoDbRepository.cs b/src/data/src/repositories/MongoDb/Mongo/MongoDbRepository.cs index b1d4a75b0..f5c8ca6f8 100644 --- a/src/data/src/repositories/MongoDb/Mongo/MongoDbRepository.cs +++ b/src/data/src/repositories/MongoDb/Mongo/MongoDbRepository.cs @@ -3,10 +3,10 @@ using System; using System.Collections.Generic; using System.Linq; -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; -namespace Ix.Framework.Data.MongoDb +namespace AXOpen.Data.MongoDb { /// /// Provides access to basic operations for MongoDB. diff --git a/src/data/src/repositories/MongoDb/Mongo/MongoDbRepositorySettings.cs b/src/data/src/repositories/MongoDb/Mongo/MongoDbRepositorySettings.cs index 858b3e698..ee692d53a 100644 --- a/src/data/src/repositories/MongoDb/Mongo/MongoDbRepositorySettings.cs +++ b/src/data/src/repositories/MongoDb/Mongo/MongoDbRepositorySettings.cs @@ -7,11 +7,11 @@ using System.Collections.Generic; using System.Linq; using System.Net.Sockets; -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; -namespace Ix.Framework.Data.MongoDb +namespace AXOpen.Data.MongoDb { /// /// diff --git a/src/data/src/repositories/MongoDb/RepositoryExtensions.cs b/src/data/src/repositories/MongoDb/RepositoryExtensions.cs index b03e509cb..bdcf1eb04 100644 --- a/src/data/src/repositories/MongoDb/RepositoryExtensions.cs +++ b/src/data/src/repositories/MongoDb/RepositoryExtensions.cs @@ -1,8 +1,8 @@ using System; -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; -namespace Ix.Framework.Data.MongoDb +namespace AXOpen.Data.MongoDb { public static class Repository { diff --git a/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Ix.Framework.Data.RavenDb.csproj b/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/AXOpen.Data.RavenDb.csproj similarity index 80% rename from src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Ix.Framework.Data.RavenDb.csproj rename to src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/AXOpen.Data.RavenDb.csproj index a2c75d088..4c83591b2 100644 --- a/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Ix.Framework.Data.RavenDb.csproj +++ b/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/AXOpen.Data.RavenDb.csproj @@ -12,7 +12,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + \ No newline at end of file diff --git a/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepository.cs b/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepository.cs index e7d19a43e..85f7f88ba 100644 --- a/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepository.cs +++ b/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepository.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Ix.Base.Data; +using AXOpen.Base.Data; using Raven.Client.Documents; using Raven.Client.Documents.Operations; using Raven.Client.Exceptions; @@ -10,7 +10,7 @@ using Raven.Client.ServerWide.Operations; -namespace Ix.Framework.Data.RavenDb +namespace AXOpen.Data.RavenDb { public static class SharedData { diff --git a/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepositorySettings.cs b/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepositorySettings.cs index 0f7970207..c6504f315 100644 --- a/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepositorySettings.cs +++ b/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepositorySettings.cs @@ -3,12 +3,12 @@ using System.Linq; using System.Net.Sockets; using System.Security.Cryptography.X509Certificates; -using Ix.Base.Data; +using AXOpen.Base.Data; using Raven.Client.Documents; using Raven.Client.Documents.Indexes; -namespace Ix.Framework.Data.RavenDb +namespace AXOpen.Data.RavenDb { public class RavenDbRepositorySettings : RavenDbRepositorySettingsBase where T : IBrowsableDataObject { diff --git a/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepositorySettingsBase.cs b/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepositorySettingsBase.cs index d77c41652..67baa5791 100644 --- a/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepositorySettingsBase.cs +++ b/src/data/src/repositories/RavenDb/Ix.Framework.Data.RavenDb/Raven/RavenDbRepositorySettingsBase.cs @@ -1,7 +1,7 @@ -using Ix.Base.Data; +using AXOpen.Base.Data; using Raven.Client.Documents; -namespace Ix.Framework.Data.RavenDb +namespace AXOpen.Data.RavenDb { public class RavenDbRepositorySettingsBase : RepositorySettings where T : IBrowsableDataObject { diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/DataTestObject.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/DataTestObject.cs index 45cf30037..8ebe4849b 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/DataTestObject.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/DataTestObject.cs @@ -1,8 +1,8 @@ using NUnit.Framework; using System; using System.Collections.Generic; -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; using AXSharp.Connector; namespace Ix.Framework.Repository.Integration.Tests diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Ix.Framework.Repository.Integration.Tests_L1.csproj b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Ix.Framework.Repository.Integration.Tests_L1.csproj index b835345f7..25702f627 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Ix.Framework.Repository.Integration.Tests_L1.csproj +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Ix.Framework.Repository.Integration.Tests_L1.csproj @@ -25,9 +25,9 @@ - - - - + + + + diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Repository/InMemoryRepositoryTests.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Repository/InMemoryRepositoryTests.cs index e94e652b1..1d8cfd263 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Repository/InMemoryRepositoryTests.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Repository/InMemoryRepositoryTests.cs @@ -1,8 +1,7 @@ using NUnit.Framework; using System; -using Ix.Base.Data; -using Ix.Framework.Data; -using Ix.Framework.Data.InMemory; +using AXOpen.Base.Data; +using AXOpen.Data.InMemory; namespace Ix.Framework.Repository.Integration.Tests { @@ -13,8 +12,8 @@ public class InMemoryRepositoryTests : RepositoryBaseTests public override void Init() { - this.repository = Data.InMemory.Repository.Factory(new InMemoryRepositorySettings()); - this.repository_altered_structure = Data.InMemory.Repository.Factory(new InMemoryRepositorySettings()); + this.repository = AXOpen.Data.InMemory.Repository.Factory(new InMemoryRepositorySettings()); + this.repository_altered_structure = AXOpen.Data.InMemory.Repository.Factory(new InMemoryRepositorySettings()); this.repository.OnCreate = (id, data) => { data._Created = DateTimeProviders.DateTimeProvider.Now; data._Modified = DateTimeProviders.DateTimeProvider.Now; }; this.repository.OnUpdate = (id, data) => { data._Modified = DateTimeProviders.DateTimeProvider.Now; }; } diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Repository/JsonRepositoryTests.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Repository/JsonRepositoryTests.cs index ab4146807..a53b171e0 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Repository/JsonRepositoryTests.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/Repository/JsonRepositoryTests.cs @@ -2,9 +2,9 @@ using System; using System.IO; using System.Reflection; -using Ix.Base.Data; -using Ix.Framework.Data; -using Ix.Framework.Data.Json; +using AXOpen.Base.Data; +using AXOpen.Data; +using AXOpen.Data.Json; using Ix.Repository.Json; namespace Ix.Framework.Repository.Integration.Tests @@ -21,8 +21,8 @@ public override void Init() Directory.Delete(outputDir, true); } - this.repository = new Data.Json.JsonRepository(new JsonRepositorySettings(outputDir)); - this.repository_altered_structure = new Data.Json.JsonRepository(new JsonRepositorySettings(outputDir)); + this.repository = new JsonRepository(new JsonRepositorySettings(outputDir)); + this.repository_altered_structure = new JsonRepository(new JsonRepositorySettings(outputDir)); this.repository.OnCreate = (id, data) => { data._Created = DateTimeProviders.DateTimeProvider.Now; data._Modified = DateTimeProviders.DateTimeProvider.Now; }; this.repository.OnUpdate = (id, data) => { data._Modified = DateTimeProviders.DateTimeProvider.Now; }; diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/RepositoryBaseTests.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/RepositoryBaseTests.cs index 40b281de8..d4c57c5ad 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/RepositoryBaseTests.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L1/RepositoryBaseTests.cs @@ -1,7 +1,7 @@ using NUnit.Framework; using System; using System.Linq; -using Ix.Base.Data; +using AXOpen.Base.Data; namespace Ix.Framework.Repository.Integration.Tests { diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/DataTestObject.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/DataTestObject.cs index 45cf30037..8ebe4849b 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/DataTestObject.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/DataTestObject.cs @@ -1,8 +1,8 @@ using NUnit.Framework; using System; using System.Collections.Generic; -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; using AXSharp.Connector; namespace Ix.Framework.Repository.Integration.Tests diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Ix.Framework.Repository.Integration.Tests_L3.csproj b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Ix.Framework.Repository.Integration.Tests_L3.csproj index a4b739d94..566923462 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Ix.Framework.Repository.Integration.Tests_L3.csproj +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Ix.Framework.Repository.Integration.Tests_L3.csproj @@ -22,7 +22,7 @@ - - + + diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/MongoDbRepositoryTest.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/MongoDbRepositoryTest.cs index ccf33cdc1..fd12a4bd0 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/MongoDbRepositoryTest.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/MongoDbRepositoryTest.cs @@ -1,7 +1,7 @@ using System; -using Ix.Base.Data; -using Ix.Framework.Data; -using Ix.Framework.Data.MongoDb; +using AXOpen.Base.Data; +using AXOpen.Data; +using AXOpen.Data.MongoDb; namespace Ix.Framework.Repository.Integration.Tests { @@ -24,9 +24,9 @@ public override void Init() var parameters = new MongoDbRepositorySettings("mongodb://localhost:27017", "TestDataBase", "TestCollection"); var parametersAltered = new MongoDbRepositorySettings("mongodb://localhost:27017", "TestDataBase", "TestCollection"); #pragma warning restore CS0618 // Type or member is obsolete - this.repository = Data.MongoDb.Repository.Factory(parameters); + this.repository = AXOpen.Data.MongoDb.Repository.Factory(parameters); - this.repository_altered_structure = Data.MongoDb.Repository.Factory(parametersAltered); + this.repository_altered_structure = AXOpen.Data.MongoDb.Repository.Factory(parametersAltered); this.repository.OnCreate = (id, data) => { data._Created = DateTimeProviders.DateTimeProvider.Now; data._Modified = DateTimeProviders.DateTimeProvider.Now; }; this.repository.OnUpdate = (id, data) => { data._Modified = DateTimeProviders.DateTimeProvider.Now; }; diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/MongoDbSecuredRepositoryTest.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/MongoDbSecuredRepositoryTest.cs index 25d39d190..4db236ac2 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/MongoDbSecuredRepositoryTest.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/MongoDbSecuredRepositoryTest.cs @@ -1,7 +1,7 @@ using System; -using Ix.Base.Data; -using Ix.Framework.Data; -using Ix.Framework.Data.MongoDb; +using AXOpen.Base.Data; +using AXOpen.Data; +using AXOpen.Data.MongoDb; namespace Ix.Framework.Repository.Integration.Tests { @@ -15,9 +15,9 @@ public override void Init() var credentials = new MongoDbCredentials("admin", "TcOpenAdmin", "changeMeToAStrongPassword"); var parameters = new MongoDbRepositorySettings(@"mongodb://localhost:27018", "TestDataBase", "TestCollection", credentials); var parametersAltered = new MongoDbRepositorySettings(@"mongodb://localhost:27018", "TestDataBase", "TestCollection", credentials); - this.repository = Data.MongoDb.Repository.Factory(parameters); + this.repository = AXOpen.Data.MongoDb.Repository.Factory(parameters); - this.repository_altered_structure = Data.MongoDb.Repository.Factory(parametersAltered); + this.repository_altered_structure = AXOpen.Data.MongoDb.Repository.Factory(parametersAltered); this.repository.OnCreate = (id, data) => { data._Created = DateTimeProviders.DateTimeProvider.Now; data._Modified = DateTimeProviders.DateTimeProvider.Now; }; this.repository.OnUpdate = (id, data) => { data._Modified = DateTimeProviders.DateTimeProvider.Now; }; diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/RavenDbRepositoryTest.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/RavenDbRepositoryTest.cs index 15c7176b1..510f28609 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/RavenDbRepositoryTest.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/RavenDbRepositoryTest.cs @@ -1,8 +1,8 @@ -using Ix.Base.Data; -using Ix.Framework.Data; +using AXOpen.Base.Data; +using AXOpen.Data; using System.IO; using System.Reflection; -using Ix.Framework.Data.RavenDb; +using AXOpen.Data.RavenDb; using Raven.Embedded; namespace Ix.Framework.Repository.Integration.Tests diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/ZFloatSerializerMongoTests.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/ZFloatSerializerMongoTests.cs index e59507713..fbf918ece 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/ZFloatSerializerMongoTests.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/Repository/ZFloatSerializerMongoTests.cs @@ -2,9 +2,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Ix.Base.Data; -using Ix.Framework.Data; -using Ix.Framework.Data.MongoDb; +using AXOpen.Base.Data; +using AXOpen.Data; +using AXOpen.Data.MongoDb; namespace Ix.Framework.Repository.Integration.Tests { @@ -44,7 +44,7 @@ public void Init() { var a = new FloatSerializerObject(); var parameters = new MongoDbRepositorySettings("mongodb://localhost:27017", "TestDataBase", nameof(ZFloatSerializerMongoTests)); - this.repository = Data.MongoDb.Repository.Factory(parameters); + this.repository = AXOpen.Data.MongoDb.Repository.Factory(parameters); foreach (var item in this.repository.GetRecords("*")) { repository.Delete(item.DataEntityId); diff --git a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/RepositoryBaseTests.cs b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/RepositoryBaseTests.cs index ea92c5453..31d29668d 100644 --- a/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/RepositoryBaseTests.cs +++ b/src/data/tests/Ix.Framework.Repository.Integration.Tests_L3/RepositoryBaseTests.cs @@ -1,7 +1,7 @@ using NUnit.Framework; using System; using System.Linq; -using Ix.Base.Data; +using AXOpen.Base.Data; namespace Ix.Framework.Repository.Integration.Tests { diff --git a/src/data/tests/ix.famework.data.tests/Example.cs b/src/data/tests/ix.famework.data.tests/Example.cs index d96e25e08..527e85059 100644 --- a/src/data/tests/ix.famework.data.tests/Example.cs +++ b/src/data/tests/ix.famework.data.tests/Example.cs @@ -1,9 +1,8 @@ using AXSharp.Connector; -using ix.framework.core; +using AXOpen.Core; -namespace ix.framework.coretests +namespace AXOpen.Core.Tests { - using ix.framework.core; using System; using Xunit; diff --git a/src/data/tests/ix.famework.data.tests/ix.framework.data.tests.csproj b/src/data/tests/ix.famework.data.tests/ix.framework.data.tests.csproj index 576dbd69b..457800f63 100644 --- a/src/data/tests/ix.famework.data.tests/ix.framework.data.tests.csproj +++ b/src/data/tests/ix.famework.data.tests/ix.framework.data.tests.csproj @@ -1,4 +1,4 @@ - + net6.0;net7.0 @@ -30,8 +30,8 @@ Always - - + + - + diff --git a/src/integrations/ctrl/apax.yml b/src/integrations/ctrl/apax.yml index 9f624dc12..98fa6b1ee 100644 --- a/src/integrations/ctrl/apax.yml +++ b/src/integrations/ctrl/apax.yml @@ -1,5 +1,5 @@ name: "integrations" -version : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' +version : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' type: app targets: # - "1500" @@ -8,9 +8,9 @@ targets: - plcsim - axunit-llvm dependencies: - "@ix-ax/ix.framework.core" : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' - "@ix-ax/ix.framework.data" : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' - "@ix-ax/ix.framework.probers" : '0.1.4-44--NEW-FEATURE-ix-data-Implement-IxDataExchange-based-on-TcoDataExchange.142' + "@ix-ax/axopen.core" : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' + "@ix-ax/axopen.data" : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' + "@ix-ax/ix.framework.probers" : '0.1.4-48--NEW-FEATURE-Implement-alarm-messaging.169' "@ax/sdk": ^3.0.11 variables: APAX_BUILD_ARGS: [ -d ] diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxComponent/IxComponentExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoComponent/AxoComponentExample.st similarity index 91% rename from src/integrations/ctrl/src/Examples/ix-core-IxComponent/IxComponentExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoComponent/AxoComponentExample.st index ee08cf658..613f9f53b 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxComponent/IxComponentExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoComponent/AxoComponentExample.st @@ -1,11 +1,11 @@ -using ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxComponentExamples +NAMESPACE AxoComponentExamples // {#ix-attr:[Container(Layout.Stack)]} - {#ix-set:AttributeName = "IxComponent example name"} - CLASS PUBLIC IxComponentExample EXTENDS ix.framework.core.IxComponent - METHOD PROTECTED OVERRIDE Restore: IIxTask + {#ix-set:AttributeName = "AxoComponent example name"} + CLASS PUBLIC AxoComponentExample EXTENDS AXOpen.Core.AxoComponent + METHOD PROTECTED OVERRIDE Restore: IAxoTask ; END_METHOD METHOD PROTECTED OVERRIDE ManualControl @@ -42,7 +42,7 @@ NAMESPACE IxComponentExamples // These tasks are going to be added to the previous members of the component header. {#ix-attr:[ComponentHeader()]} {#ix-set:AttributeName = "Header task 1"} - HeaderTask1 : IxTask; + HeaderTask1 : AxoTask; // Complete structure as a part of the component details tab `Tasks`. // All structure members are going to be added to the previous members of the component details tab `Tasks`. @@ -55,13 +55,13 @@ NAMESPACE IxComponentExamples {#ix-attr:[ComponentDetails("Tasks")]} {#ix-attr:[Container(Layout.Stack)]} {#ix-set:AttributeName = "Detail task in Tasks tab"} - DetailTaskInTasksTab : IxTask; + DetailTaskInTasksTab : AxoTask; // Additional separate task as a part of the component header. // This task is going to be added to the previous members of the component header. {#ix-attr:[ComponentHeader()]} {#ix-set:AttributeName = "Header task 2"} - HeaderTask2 : IxTask; + HeaderTask2 : AxoTask; // Complete structure as a part of the component details tab `Status` as the attribute [ComponentDetails("Status")] // is defined on the class Status_ComponentExample. @@ -80,7 +80,7 @@ NAMESPACE IxComponentExamples // This task is going to be added to the previous members of the component header. {#ix-attr:[ComponentHeader()]} {#ix-set:AttributeName = "Header task 3"} - HeaderTask3 : IxTask; + HeaderTask3 : AxoTask; // Complete structure as a part of the component details tab `Settings` as the attribute [ComponentDetails("Settings")] // is defined on the class Settings_ComponentExample. @@ -109,9 +109,9 @@ NAMESPACE IxComponentExamples CLASS PUBLIC Header_ComponentExample VAR PUBLIC {#ix-set:AttributeName = "Start"} - Start : IxTask; + Start : AxoTask; {#ix-set:AttributeName = "Stop"} - Stop : IxTask; + Stop : AxoTask; {#ix-set:AttributeName = "Status"} Status : STRING:='Some status description'; END_VAR @@ -124,15 +124,15 @@ NAMESPACE IxComponentExamples {#ix-set:AttributeName = "Some status value 1"} SomeStatusValue1 : REAL := REAL#45.3; {#ix-set:AttributeName = "Some advanced component task 1"} - SomeAdvancedComponentTask1 : IxTask; + SomeAdvancedComponentTask1 : AxoTask; {#ix-set:AttributeName = "Some advanced component task 2"} - SomeAdvancedComponentTask2 : IxTask; + SomeAdvancedComponentTask2 : AxoTask; {#ix-set:AttributeName = "Some advanced component task 3"} - SomeAdvancedComponentTask3 : IxTask; + SomeAdvancedComponentTask3 : AxoTask; {#ix-set:AttributeName = "Some advanced component task 4"} - SomeAdvancedComponentTask4 : IxTask; + SomeAdvancedComponentTask4 : AxoTask; {#ix-set:AttributeName = "Some advanced component task 5"} - SomeAdvancedComponentTask5 : IxTask; + SomeAdvancedComponentTask5 : AxoTask; END_VAR END_CLASS @@ -182,10 +182,10 @@ NAMESPACE IxComponentExamples // // - CLASS ComponentExampleContext EXTENDS ix.framework.core.IxContext + CLASS ComponentExampleContext EXTENDS AxoContext VAR PUBLIC {#ix-set:AttributeName = "Component example name"} - MyComponent : IxComponentExample; + MyComponent : AxoComponentExample; {#ix-set:AttributeName = "<#Activate manual control#>"} ActivateManualControl : BOOL; diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxComponent/IxComponentHeaderOnlyExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoComponent/AxoComponentHeaderOnlyExample.st similarity index 81% rename from src/integrations/ctrl/src/Examples/ix-core-IxComponent/IxComponentHeaderOnlyExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoComponent/AxoComponentHeaderOnlyExample.st index 44817ce81..897d6361d 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxComponent/IxComponentHeaderOnlyExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoComponent/AxoComponentHeaderOnlyExample.st @@ -1,11 +1,11 @@ -using ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxComponentExamples +NAMESPACE AxoComponentExamples // {#ix-attr:[Container(Layout.Stack)]} - {#ix-set:AttributeName = "IxComponent with header only example"} - CLASS PUBLIC IxComponentHeaderOnlyExample EXTENDS ix.framework.core.IxComponent - METHOD PROTECTED OVERRIDE Restore: IIxTask + {#ix-set:AttributeName = "AxoComponent with header only example"} + CLASS PUBLIC AxoComponentHeaderOnlyExample EXTENDS AXOpen.Core.AxoComponent + METHOD PROTECTED OVERRIDE Restore: IAxoTask // Some logic for Restore could be placed here. For Example: valueReal := REAL#1.0; valueDint := DINT#0; @@ -16,11 +16,11 @@ NAMESPACE IxComponentExamples ; END_METHOD - // Main method of the `IxComponent` that must be - // called inside the `IxContext` cyclically. + // Main method of the `AxoComponent` that must be + // called inside the `AxoContext` cyclically. METHOD PUBLIC Run // Declaration of the input and output variables. - // In the case of "hardware-related" `IxComponent`, + // In the case of "hardware-related" `AxoComponent`, // these would be the variables linked to the hardware. VAR_INPUT inReal : REAL; @@ -55,10 +55,10 @@ NAMESPACE IxComponentExamples // // - CLASS ComponentHeaderOnlyExampleContext EXTENDS ix.framework.core.IxContext + CLASS ComponentHeaderOnlyExampleContext EXTENDS AxoContext VAR PUBLIC {#ix-set:AttributeName = "Very simple component example with header only defined"} - MyComponentWithHeaderOnly : IxComponentHeaderOnlyExample; + MyComponentWithHeaderOnly : AxoComponentHeaderOnlyExample; {#ix-set:AttributeName = "<#Activate manual control#>"} ActivateManualControl : BOOL; diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxContext/IxContextExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoContext/AxoContextExample.st similarity index 57% rename from src/integrations/ctrl/src/Examples/ix-core-IxContext/IxContextExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoContext/AxoContextExample.st index 742c7eefb..e918075bd 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxContext/IxContextExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoContext/AxoContextExample.st @@ -1,9 +1,9 @@ -using ix.framework.core; +USING AXOpen.Core; // PROGRAM ProgramExample VAR - MyContext : IxContextExample; + MyContext : AxoContextExample; END_VAR MyContext.Run(); @@ -12,9 +12,9 @@ using ix.framework.core; // // - CLASS PUBLIC IxContextExample EXTENDS IxContext + CLASS PUBLIC AxoContextExample EXTENDS AXOpen.Core.AxoContext METHOD PROTECTED OVERRIDE Main - // Here goes all your logic for given IxContext. + // Here goes all your logic for given AxoContext. ; END_METHOD END_CLASS diff --git a/src/integrations/ctrl/src/Examples/ix-data/IxProcessDataManager.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProcessDataManager.st similarity index 57% rename from src/integrations/ctrl/src/Examples/ix-data/IxProcessDataManager.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProcessDataManager.st index bb18ef5fe..2056cf5ad 100644 --- a/src/integrations/ctrl/src/Examples/ix-data/IxProcessDataManager.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProcessDataManager.st @@ -1,8 +1,8 @@ -using ix.framework.data; +using AXOpen.Data; -NAMESPACE ixDataExamples +NAMESPACE AxoDataExamples - CLASS IxProcessDataManager EXTENDS ix.framework.data.DataExchange + CLASS AxoProcessDataManager EXTENDS AXOpen.Data.AxoDataExchange VAR PUBLIC _identifier : STRING; _create : BOOL; @@ -10,8 +10,8 @@ NAMESPACE ixDataExamples _update : BOOL; _delete : BOOL; {#ix-attr:[DataEntityAttribute]} - _data : IxProductionData; - // _data : IxProductionDataInherited; + _data : AxoProductionData; + // _data : AxoProductionDataInherited; END_VAR END_CLASS END_NAMESPACE \ No newline at end of file diff --git a/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProductionData.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProductionData.st new file mode 100644 index 000000000..07fac6fd9 --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProductionData.st @@ -0,0 +1,12 @@ +using AXOpen.Data; + +NAMESPACE AxoDataExamples + + CLASS AxoProductionData EXTENDS AXOpen.Data.AxoDataEntity + VAR PUBLIC + RecipeName : STRING; + END_VAR + END_CLASS + + +END_NAMESPACE \ No newline at end of file diff --git a/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProductionDataInherited.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProductionDataInherited.st new file mode 100644 index 000000000..aa63178cd --- /dev/null +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoProductionDataInherited.st @@ -0,0 +1,12 @@ +using AXOpen.Data; + +NAMESPACE AxoDataExamples + + CLASS AxoProductionDataInherited EXTENDS AxoProductionData + VAR PUBLIC + RecipeName2 : STRING; + END_VAR + END_CLASS + + +END_NAMESPACE \ No newline at end of file diff --git a/src/integrations/ctrl/src/Examples/ix-data/IxTestData.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestData.st similarity index 63% rename from src/integrations/ctrl/src/Examples/ix-data/IxTestData.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestData.st index 04004f520..7db3ca868 100644 --- a/src/integrations/ctrl/src/Examples/ix-data/IxTestData.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestData.st @@ -1,9 +1,9 @@ -using ix.framework.data; +using AXOpen.Data; -NAMESPACE ixDataExamples +NAMESPACE AxoDataExamples {#ix-attr:[Container(Layout.Tabs)]} - CLASS IxTestData EXTENDS ix.framework.data.DataEntity + CLASS AxoTestData EXTENDS AXOpen.Data.AxoDataEntity VAR PUBLIC RecipeName : STRING; String1 : STRING; @@ -15,13 +15,13 @@ NAMESPACE ixDataExamples String3 : STRING; Int3 : INT; Bool3 : BOOL; - TestDataStructude : IxTestDataStructure; + TestDataStructude : AxoTestDataStructure; {#ix-attr:[Container(Layout.UniformGrid)]} - TestDataStructude2 : IxTestDataStructure; + TestDataStructude2 : AxoTestDataStructure; {#ix-attr:[Container(Layout.Stack)]} - TestDataStructude3 : IxTestDataStructure; + TestDataStructude3 : AxoTestDataStructure; {#ix-attr:[Container(Layout.Wrap)]} - TestDataStructude4 : IxTestDataStructure; + TestDataStructude4 : AxoTestDataStructure; END_VAR END_CLASS diff --git a/src/integrations/ctrl/src/Examples/ix-data/IxTestDataManager.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestDataManager.st similarity index 66% rename from src/integrations/ctrl/src/Examples/ix-data/IxTestDataManager.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestDataManager.st index af9370077..cd387e6fb 100644 --- a/src/integrations/ctrl/src/Examples/ix-data/IxTestDataManager.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestDataManager.st @@ -1,8 +1,8 @@ -using ix.framework.data; +using AXOpen.Data; -NAMESPACE ixDataExamples +NAMESPACE AxoDataExamples - CLASS IxTestDataManager EXTENDS ix.framework.data.DataExchange + CLASS AxoTestDataManager EXTENDS AXOpen.Data.AxoDataExchange VAR PUBLIC _identifier : STRING; _create : BOOL; @@ -10,7 +10,7 @@ NAMESPACE ixDataExamples _update : BOOL; _delete : BOOL; {#ix-attr:[DataEntityAttribute]} - _data : IxTestData; + _data : AxoTestData; END_VAR END_CLASS END_NAMESPACE \ No newline at end of file diff --git a/src/integrations/ctrl/src/Examples/ix-data/IxTestDataStructure.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestDataStructure.st similarity index 81% rename from src/integrations/ctrl/src/Examples/ix-data/IxTestDataStructure.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestDataStructure.st index 83931b4ae..22bbf70a6 100644 --- a/src/integrations/ctrl/src/Examples/ix-data/IxTestDataStructure.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoData/AxoTestDataStructure.st @@ -1,8 +1,8 @@ -using ix.framework.data; +using AXOpen.Data; -NAMESPACE ixDataExamples +NAMESPACE AxoDataExamples - CLASS IxTestDataStructure + CLASS AxoTestDataStructure VAR PUBLIC RecipeName : STRING; String1 : STRING; diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxObject/IxObjectExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoObject/AxoObjectExample.st similarity index 52% rename from src/integrations/ctrl/src/Examples/ix-core-IxObject/IxObjectExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoObject/AxoObjectExample.st index 0fd6d50db..12af9ccdf 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxObject/IxObjectExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoObject/AxoObjectExample.st @@ -1,24 +1,24 @@ -USING ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxObjectExamples -// - CLASS PUBLIC MyContext EXTENDS IxContext +NAMESPACE AxoObjectExamples +// + CLASS PUBLIC MyContext EXTENDS AXOpen.Core.AxoContext VAR - _myObject : IxObject; + _myObject : AxoObject; END_VAR METHOD PROTECTED OVERRIDE Main _myObject.Initialize(THIS); END_METHOD END_CLASS -// -// - CLASS PUBLIC MyParentObject EXTENDS IxContext +// +// + CLASS PUBLIC MyParentObject EXTENDS AxoContext VAR - _myChildObject : IxObject; + _myChildObject : AxoObject; END_VAR METHOD PROTECTED OVERRIDE Main _myChildObject.Initialize(THIS); END_METHOD END_CLASS -// +// END_NAMESPACE \ No newline at end of file diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxRemoteTask/IxRemoteTaskDocuExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoRemoteTask/AxoRemoteTaskDocuExample.st similarity index 89% rename from src/integrations/ctrl/src/Examples/ix-core-IxRemoteTask/IxRemoteTaskDocuExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoRemoteTask/AxoRemoteTaskDocuExample.st index 5bb39ab1c..ae589fb93 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxRemoteTask/IxRemoteTaskDocuExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoRemoteTask/AxoRemoteTaskDocuExample.st @@ -1,13 +1,13 @@ -using ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxRemoteTaskDocuExamples +NAMESPACE AxoRemoteTaskDocuExamples // - CLASS MyRemoteTask EXTENDS IxRemoteTask + CLASS MyRemoteTask EXTENDS AXOpen.Core.AxoRemoteTask VAR PUBLIC Message : STRING[254]; END_VAR - METHOD PUBLIC Invoke : IIxTaskState + METHOD PUBLIC Invoke : IAxoTaskState VAR_INPUT LogMessage : STRING[254]; END_VAR; @@ -17,7 +17,7 @@ NAMESPACE IxRemoteTaskDocuExamples END_CLASS // - CLASS RemoteTasks EXTENDS ix.framework.core.IxContext + CLASS RemoteTasks EXTENDS AXOpen.Core.AxoContext VAR PUBLIC _remoteTask : MyRemoteTask; _remoteTaskInvokeFromPlc : BOOL; diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxRemoteTask/IxRemoteTaskExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoRemoteTask/AxoRemoteTaskExample.st similarity index 84% rename from src/integrations/ctrl/src/Examples/ix-core-IxRemoteTask/IxRemoteTaskExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoRemoteTask/AxoRemoteTaskExample.st index 6b9c672a8..21bcbe613 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxRemoteTask/IxRemoteTaskExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoRemoteTask/AxoRemoteTaskExample.st @@ -1,15 +1,15 @@ -using ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxRemoteTaskExamples +NAMESPACE AxoRemoteTaskExamples - CLASS MyRemoteTask EXTENDS ix.framework.core.IxRemoteTask + CLASS MyRemoteTask EXTENDS AXOpen.Core.AxoRemoteTask VAR PUBLIC Message : STRING[254]; Counter : INT; END_VAR - METHOD PUBLIC Invoke : IIxTaskState + METHOD PUBLIC Invoke : IAxoTaskState VAR_INPUT LogMessage : STRING[254]; LogCounter : INT; @@ -21,7 +21,7 @@ NAMESPACE IxRemoteTaskExamples END_CLASS - CLASS RemoteTasks EXTENDS ix.framework.core.IxContext + CLASS RemoteTasks EXTENDS AXOpen.Core.AxoContext VAR PUBLIC {#ix-set:AttributeName = "Click to execute this command"} _remoteTask : MyRemoteTask; diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxSequencer/IxSequencerDocuExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoSequencer/AxoSequencerDocuExample.st similarity index 87% rename from src/integrations/ctrl/src/Examples/ix-core-IxSequencer/IxSequencerDocuExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoSequencer/AxoSequencerDocuExample.st index 0c53da215..6cc721e1f 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxSequencer/IxSequencerDocuExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoSequencer/AxoSequencerDocuExample.st @@ -1,12 +1,12 @@ -using ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxSequencerExamples - CLASS IxSequencerDocuExample EXTENDS IxContext +NAMESPACE AxoSequencerExamples + CLASS AxoSequencerDocuExample EXTENDS AXOpen.Core.AxoContext VAR PUBLIC - _mySequencer : IxSequencer; - _step_1 : IxStep; - _step_2 : IxStep; - _step_3 : IxStep; + _mySequencer : AXOpen.Core.AxoSequencer; + _step_1 : AxoStep; + _step_2 : AxoStep; + _step_3 : AxoStep; _myCounter : ULINT; END_VAR diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxSequencer/IxSequencerExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoSequencer/AxoSequencerExample.st similarity index 89% rename from src/integrations/ctrl/src/Examples/ix-core-IxSequencer/IxSequencerExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoSequencer/AxoSequencerExample.st index 87d889e27..35bb9a99f 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxSequencer/IxSequencerExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoSequencer/AxoSequencerExample.st @@ -1,35 +1,35 @@ -using ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxSequencerExamples +NAMESPACE AxoSequencerExamples - CLASS SequencerExample EXTENDS ix.framework.core.IxContext + CLASS SequencerExample EXTENDS AXOpen.Core.AxoContext VAR PUBLIC {#ix-set:AttributeName = "<#Sequencer example#>"} - coord : IxSequencer; + coord : AxoSequencer; Counter : ULINT; END_VAR VAR PUBLIC {#ix-set:Description = "Step number one"} - step_1 : IxStep; + step_1 : AxoStep; {#ix-set:Description = "Step number two"} - step_2 : IxStep; + step_2 : AxoStep; {#ix-set:Description = "Step number three"} - step_3 : IxStep; + step_3 : AxoStep; {#ix-set:Description = "Step number four"} - step_4 : IxStep; + step_4 : AxoStep; {#ix-set:Description = "Step number five"} - step_5 : IxStep; + step_5 : AxoStep; {#ix-set:Description = "Step number six"} - step_6 : IxStep; + step_6 : AxoStep; {#ix-set:Description = "Step number seven"} - step_7 : IxStep; + step_7 : AxoStep; {#ix-set:Description = "Step number eight"} - step_8 : IxStep; + step_8 : AxoStep; {#ix-set:Description = "Step number nine"} - step_9 : IxStep; + step_9 : AxoStep; {#ix-set:Description = "Step number ten"} - step_10 : IxStep; + step_10 : AxoStep; END_VAR METHOD PROTECTED OVERRIDE Main diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxTask/IxTaskDocuExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoTask/AxoTaskDocuExample.st similarity index 92% rename from src/integrations/ctrl/src/Examples/ix-core-IxTask/IxTaskDocuExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoTask/AxoTaskDocuExample.st index 74f1374db..6b0df4a2e 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxTask/IxTaskDocuExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoTask/AxoTaskDocuExample.st @@ -1,9 +1,9 @@ -USING ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxTaskExamples - CLASS IxTaskDocuExample EXTENDS IxContext +NAMESPACE AxoTaskExamples + CLASS AxoTaskDocuExample EXTENDS AXOpen.Core.AxoContext VAR PUBLIC - _myTask : IxTask; + _myTask : AxoTask; _myCounter : ULINT; END_VAR @@ -55,7 +55,7 @@ NAMESPACE IxTaskExamples END_CLASS // - CLASS MyTaskExample Extends ix.framework.core.IxTask + CLASS MyTaskExample EXTENDS AXOpen.Core.AxoTask VAR OnAbortCounter : ULINT; OnResumeCounter : ULINT; diff --git a/src/integrations/ctrl/src/Examples/ix-core-IxTask/IxTaskExample.st b/src/integrations/ctrl/src/Examples/AXOpen.AxoTask/AxoTaskExample.st similarity index 87% rename from src/integrations/ctrl/src/Examples/ix-core-IxTask/IxTaskExample.st rename to src/integrations/ctrl/src/Examples/AXOpen.AxoTask/AxoTaskExample.st index 4a917b103..2cfc37c1e 100644 --- a/src/integrations/ctrl/src/Examples/ix-core-IxTask/IxTaskExample.st +++ b/src/integrations/ctrl/src/Examples/AXOpen.AxoTask/AxoTaskExample.st @@ -1,8 +1,8 @@ -using ix.framework.core; +USING AXOpen.Core; -NAMESPACE IxTaskExamples +NAMESPACE AxoTaskExamples - CLASS MyCommandTask EXTENDS ix.framework.core.IxTask + CLASS MyCommandTask EXTENDS AXOpen.Core.AxoTask VAR PUBLIC {#ix-set:AttributeName = "Counter"} _counter : ULINT; @@ -13,7 +13,7 @@ NAMESPACE IxTaskExamples END_METHOD END_CLASS - CLASS Tasks EXTENDS ix.framework.core.IxContext + CLASS Tasks EXTENDS AXOpen.Core.AxoContext VAR PUBLIC {#ix-set:AttributeName = "Click to execute this command"} _commandTask : MyCommandTask; diff --git a/src/integrations/ctrl/src/Examples/ix-data/IxProductionData.st b/src/integrations/ctrl/src/Examples/ix-data/IxProductionData.st deleted file mode 100644 index 9bc169f1f..000000000 --- a/src/integrations/ctrl/src/Examples/ix-data/IxProductionData.st +++ /dev/null @@ -1,12 +0,0 @@ -using ix.framework.data; - -NAMESPACE ixDataExamples - - CLASS IxProductionData EXTENDS ix.framework.data.DataEntity - VAR PUBLIC - RecipeName : STRING; - END_VAR - END_CLASS - - -END_NAMESPACE \ No newline at end of file diff --git a/src/integrations/ctrl/src/Examples/ix-data/IxProductionDataInherited.st b/src/integrations/ctrl/src/Examples/ix-data/IxProductionDataInherited.st deleted file mode 100644 index d2b888306..000000000 --- a/src/integrations/ctrl/src/Examples/ix-data/IxProductionDataInherited.st +++ /dev/null @@ -1,12 +0,0 @@ -using ix.framework.data; - -NAMESPACE ixDataExamples - - CLASS IxProductionDataInherited EXTENDS IxProductionData - VAR PUBLIC - RecipeName2 : STRING; - END_VAR - END_CLASS - - -END_NAMESPACE \ No newline at end of file diff --git a/src/integrations/ctrl/src/IntegrationTests/data/DataExchangeLightTests.st b/src/integrations/ctrl/src/IntegrationTests/data/DataExchangeLightTests.st index 47cc2eccb..4e4ab8284 100644 --- a/src/integrations/ctrl/src/IntegrationTests/data/DataExchangeLightTests.st +++ b/src/integrations/ctrl/src/IntegrationTests/data/DataExchangeLightTests.st @@ -1,11 +1,11 @@ -USING ix.framework.core; -USING ix.framework.data; +USING AXOpen.Core; +USING AXOpen.Data; USING ix.framework.probers; NAMESPACE IntegrationLightDirect - CLASS DataExchangeLightTestsContext EXTENDS IxContext + CLASS DataExchangeLightTestsContext EXTENDS AxoContext VAR PUBLIC - DM : IDataExchange; + DM : IAxoDataExchange; CreateTest : DataCreateTest; ReadTest : DataReadTest; UpdateTest : DataUpdateTest; @@ -14,7 +14,7 @@ NAMESPACE IntegrationLightDirect METHOD PUBLIC InjectDM VAR_INPUT - iDM : IDataExchange; + iDM : IAxoDataExchange; END_VAR DM := iDM; END_METHOD @@ -39,12 +39,12 @@ NAMESPACE IntegrationLightDirect CLASS DataCreateTest EXTENDS ProberWithCompletedCondition VAR PUBLIC - Manager : IDataExchange; + Manager : IAxoDataExchange; Identifier : STRING[254]; END_VAR METHOD PROTECTED OVERRIDE Test : BOOL VAR - _taskState : IIxTaskState; + _taskState : IAxoTaskState; END_VAR IF(Manager <> NULL) THEN _taskState := Manager.Create(Identifier); @@ -62,7 +62,7 @@ NAMESPACE IntegrationLightDirect METHOD PUBLIC InjectManger VAR_INPUT - Injectee : IDataExchange; + Injectee : IAxoDataExchange; END_VAR Manager := Injectee; END_METHOD @@ -70,12 +70,12 @@ NAMESPACE IntegrationLightDirect CLASS DataReadTest EXTENDS ProberWithCompletedCondition VAR PUBLIC - Manager : IDataExchange; + Manager : IAxoDataExchange; Identifier : STRING[254]; END_VAR METHOD PROTECTED OVERRIDE Test : BOOL VAR - _taskState : IIxTaskState; + _taskState : IAxoTaskState; END_VAR IF(Manager <> NULL) THEN _taskState := Manager.Read(Identifier); @@ -93,7 +93,7 @@ NAMESPACE IntegrationLightDirect METHOD PUBLIC InjectManger VAR_INPUT - Injectee : IDataExchange; + Injectee : IAxoDataExchange; END_VAR Manager := Injectee; END_METHOD @@ -101,12 +101,12 @@ NAMESPACE IntegrationLightDirect CLASS DataUpdateTest EXTENDS ProberWithCompletedCondition VAR PUBLIC - Manager : IDataExchange; + Manager : IAxoDataExchange; Identifier : STRING[254]; END_VAR METHOD PROTECTED OVERRIDE Test : BOOL VAR - _taskState : IIxTaskState; + _taskState : IAxoTaskState; END_VAR IF(Manager <> NULL) THEN _taskState := Manager.Update(Identifier); @@ -124,7 +124,7 @@ NAMESPACE IntegrationLightDirect METHOD PUBLIC InjectManger VAR_INPUT - Injectee : IDataExchange; + Injectee : IAxoDataExchange; END_VAR Manager := Injectee; END_METHOD @@ -132,12 +132,12 @@ NAMESPACE IntegrationLightDirect CLASS DataDeleteTest EXTENDS ProberWithCompletedCondition VAR PUBLIC - Manager : IDataExchange; + Manager : IAxoDataExchange; Identifier : STRING[254]; END_VAR METHOD PROTECTED OVERRIDE Test : BOOL VAR - _taskState : IIxTaskState; + _taskState : IAxoTaskState; END_VAR IF(Manager <> NULL) THEN _taskState := Manager.Delete(Identifier); @@ -155,20 +155,20 @@ NAMESPACE IntegrationLightDirect METHOD PUBLIC InjectManger VAR_INPUT - Injectee : IDataExchange; + Injectee : IAxoDataExchange; END_VAR Manager := Injectee; END_METHOD END_CLASS - CLASS DataManager EXTENDS ix.framework.data.DataExchange + CLASS DataManager EXTENDS AXOpen.Data.AxoDataExchange VAR PUBLIC {#ix-attr:[DataEntityAttribute]} _data : DataSet; END_VAR END_CLASS - CLASS DataSet EXTENDS ix.framework.data.DataEntity + CLASS DataSet EXTENDS AXOpen.Data.AxoDataEntity VAR PUBLIC SomeData : STRING; END_VAR diff --git a/src/integrations/ctrl/src/IntegrationTests/probers/ProbersTest.st b/src/integrations/ctrl/src/IntegrationTests/probers/ProbersTest.st index 58a91d328..d6d826b0e 100644 --- a/src/integrations/ctrl/src/IntegrationTests/probers/ProbersTest.st +++ b/src/integrations/ctrl/src/IntegrationTests/probers/ProbersTest.st @@ -1,10 +1,10 @@ -USING ix.framework.core; +USING AXOpen.Core; USING ix.framework.probers; NAMESPACE IntegrationTests -CLASS ProbersTestContext EXTENDS IxContext +CLASS ProbersTestContext EXTENDS AxoContext VAR PUBLIC ProbeWithCounterTests : ProbeWithCounterTests; ProbeWithEndConditionTests : ProberWithCompletedConditionTests; diff --git a/src/integrations/ctrl/src/configuration.st b/src/integrations/ctrl/src/configuration.st index f78fa93e8..d64e3c1a3 100644 --- a/src/integrations/ctrl/src/configuration.st +++ b/src/integrations/ctrl/src/configuration.st @@ -4,20 +4,20 @@ CONFIGURATION MyConfiguration PROGRAM P2 WITH Main: ProgramExample; VAR_GLOBAL - ixcoreTasks : IxTaskExamples.Tasks; - ixcoreSequencers : IxSequencerExamples.SequencerExample; + AxoTasks : AxoTaskExamples.Tasks; + AxoSequencers : AxoSequencerExamples.SequencerExample; {#ix-attr:[Container(Layout.Wrap)]} MainContext : MyContext; Recipe : Recipe; - myComponentExample : IxComponentExamples.ComponentExampleContext; - myComponentHeaderOnlyExample : IxComponentExamples.ComponentHeaderOnlyExampleContext; + myComponentExample : AxoComponentExamples.ComponentExampleContext; + myComponentHeaderOnlyExample : AxoComponentExamples.ComponentHeaderOnlyExampleContext; {#ix-set:AttributeName = "If counting PLC is alive"} I_am_alive : ULINT; - ixcore_remote_tasks : IxRemoteTaskExamples.RemoteTasks; + AxoRemoteTasks : AxoRemoteTaskExamples.RemoteTasks; - process_data_manager: ixDataExamples.IxProcessDataManager; - test_data_manager: ixDataExamples.IxTestDataManager; + process_data_manager: AxoDataExamples.AxoProcessDataManager; + test_data_manager: AxoDataExamples.AxoTestDataManager; // Issues gh_ptku_8 : Layouts.Tabbed.weather; diff --git a/src/integrations/ctrl/src/program.st b/src/integrations/ctrl/src/program.st index 67602f20a..c38b2d4f1 100644 --- a/src/integrations/ctrl/src/program.st +++ b/src/integrations/ctrl/src/program.st @@ -1,12 +1,14 @@ +USING AXOpen.Core; + PROGRAM MyProgram VAR_EXTERNAL MainContext : MyContext; - ixcoreSequencers : IxSequencerExamples.SequencerExample; + AxoSequencers : AxoSequencerExamples.SequencerExample; I_am_alive : ULINT; - ixcoreTasks : IxTaskExamples.Tasks; - myComponentExample : IxComponentExamples.ComponentExampleContext; - myComponentHeaderOnlyExample : IxComponentExamples.ComponentHeaderOnlyExampleContext; - ixcore_remote_tasks : IxRemoteTaskExamples.RemoteTasks; + AxoTasks : AxoTaskExamples.Tasks; + myComponentExample : AxoComponentExamples.ComponentExampleContext; + myComponentHeaderOnlyExample : AxoComponentExamples.ComponentHeaderOnlyExampleContext; + AxoRemoteTasks : AxoRemoteTaskExamples.RemoteTasks; @@ -15,11 +17,11 @@ PROGRAM MyProgram END_VAR I_am_alive := I_am_alive + ULINT#1; MainContext.Run(); - ixcoreTasks.Run(); - ixcoreSequencers.Run(); + AxoTasks.Run(); + AxoSequencers.Run(); myComponentExample.Run(); myComponentHeaderOnlyExample.Run(); - ixcore_remote_tasks.Run(); + AxoRemoteTasks.Run(); // Integration tests Integrations.Run(); @@ -27,10 +29,10 @@ PROGRAM MyProgram END_PROGRAM -CLASS MyContext EXTENDS ix.framework.core.IxContext +CLASS MyContext EXTENDS AxoContext VAR PUBLIC - process_data_manager: ixDataExamples.IxProcessDataManager; - test_data_manager: ixDataExamples.IxTestDataManager; + process_data_manager: AxoDataExamples.AxoProcessDataManager; + test_data_manager: AxoDataExamples.AxoTestDataManager; END_VAR METHOD PROTECTED OVERRIDE Main diff --git a/src/integrations/integration.blazor/Pages/IxCore/IxCoreComponentExample.razor b/src/integrations/integration.blazor/Pages/AxoCore/AxoComponentExample.razor similarity index 86% rename from src/integrations/integration.blazor/Pages/IxCore/IxCoreComponentExample.razor rename to src/integrations/integration.blazor/Pages/AxoCore/AxoComponentExample.razor index bd77d4165..bb75b34ec 100644 --- a/src/integrations/integration.blazor/Pages/IxCore/IxCoreComponentExample.razor +++ b/src/integrations/integration.blazor/Pages/AxoCore/AxoComponentExample.razor @@ -1,11 +1,11 @@ -@page "/IxCoreComponentExample" +@page "/AxoComponentExample" @using intergrations -@using ix.framework.core; -

IxCoreComponentExample

+@using AXOpen.Core; +

AxoComponentExample

- Simple IxComponent example + Simple AxoComponent example
diff --git a/src/integrations/integration.blazor/Pages/IxCore/IxCoreComponentHeaderOnlyExample.razor b/src/integrations/integration.blazor/Pages/AxoCore/AxoComponentHeaderOnlyExample.razor similarity index 85% rename from src/integrations/integration.blazor/Pages/IxCore/IxCoreComponentHeaderOnlyExample.razor rename to src/integrations/integration.blazor/Pages/AxoCore/AxoComponentHeaderOnlyExample.razor index 7db539418..f763a7a95 100644 --- a/src/integrations/integration.blazor/Pages/IxCore/IxCoreComponentHeaderOnlyExample.razor +++ b/src/integrations/integration.blazor/Pages/AxoCore/AxoComponentHeaderOnlyExample.razor @@ -1,11 +1,11 @@ -@page "/IxCoreComponentHeaderOnlyExample" +@page "/AxoComponentHeaderOnlyExample" @using intergrations -@using ix.framework.core; -

IxCoreComponentHeaderOnlyExample

+@using AXOpen.Core; +

AxoComponentHeaderOnlyExample

- Simple IxComponent example + Simple AxoComponent example
diff --git a/src/integrations/integration.blazor/Pages/IxCore/IxCoreRemoteTask.razor b/src/integrations/integration.blazor/Pages/AxoCore/AxoRemoteTask.razor similarity index 53% rename from src/integrations/integration.blazor/Pages/IxCore/IxCoreRemoteTask.razor rename to src/integrations/integration.blazor/Pages/AxoCore/AxoRemoteTask.razor index 019bb1e5c..88b163ac4 100644 --- a/src/integrations/integration.blazor/Pages/IxCore/IxCoreRemoteTask.razor +++ b/src/integrations/integration.blazor/Pages/AxoCore/AxoRemoteTask.razor @@ -1,43 +1,43 @@ -@page "/IxCoreRemoteTask" +@page "/AxoRemoteTask" @using intergrations -@using ix.framework.core; -

IxTask

+@using AXOpen.Core; +

AxoTask

Simple Command Task Example.
- +
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
diff --git a/src/integrations/integration.blazor/Pages/AxoCore/AxoSequencer.razor b/src/integrations/integration.blazor/Pages/AxoCore/AxoSequencer.razor new file mode 100644 index 000000000..ea8b89f47 --- /dev/null +++ b/src/integrations/integration.blazor/Pages/AxoCore/AxoSequencer.razor @@ -0,0 +1,26 @@ +@page "/AxoSequencer" +@using intergrations +@using AXOpen.Core; +

AxoSequencer

+ +
+
+ Sequencer with few steps +
+ +
+
+ +RenderableContentControl Context="@Entry.Plc.AxoSequencers" Presentation="Command-Control" +
+
+ +
+
+ +RenderableContentControl Context="@Entry.Plc.AxoSequencers" Presentation="Status-Display" +
+
+ +
+
diff --git a/src/integrations/integration.blazor/Pages/IxCore/IxCoreTask.razor b/src/integrations/integration.blazor/Pages/AxoCore/AxoTask.razor similarity index 59% rename from src/integrations/integration.blazor/Pages/IxCore/IxCoreTask.razor rename to src/integrations/integration.blazor/Pages/AxoCore/AxoTask.razor index f18717de8..693feea44 100644 --- a/src/integrations/integration.blazor/Pages/IxCore/IxCoreTask.razor +++ b/src/integrations/integration.blazor/Pages/AxoCore/AxoTask.razor @@ -1,7 +1,7 @@ -@page "/IxCoreTask" +@page "/AxoTask" @using intergrations -@using ix.framework.core; -

IxTask

+@using AXOpen.Core; +

AxoTask

@@ -13,30 +13,30 @@
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
diff --git a/src/integrations/integration.blazor/Pages/AxoData/AxoData.razor b/src/integrations/integration.blazor/Pages/AxoData/AxoData.razor new file mode 100644 index 000000000..891d436b5 --- /dev/null +++ b/src/integrations/integration.blazor/Pages/AxoData/AxoData.razor @@ -0,0 +1,4 @@ +@page "/AxoData" +

AxoData

+ + diff --git a/src/integrations/integration.blazor/Pages/AxoData/AxoDataRemote.razor b/src/integrations/integration.blazor/Pages/AxoData/AxoDataRemote.razor new file mode 100644 index 000000000..31793e5c3 --- /dev/null +++ b/src/integrations/integration.blazor/Pages/AxoData/AxoDataRemote.razor @@ -0,0 +1,27 @@ +@page "/AxoDataRemote" +

AxoDataRemote

+ +@**@ + + + +@code { + +} diff --git a/src/integrations/integration.blazor/Pages/IxCore/IxCoreSequencer.razor b/src/integrations/integration.blazor/Pages/IxCore/IxCoreSequencer.razor deleted file mode 100644 index 7a5809fcd..000000000 --- a/src/integrations/integration.blazor/Pages/IxCore/IxCoreSequencer.razor +++ /dev/null @@ -1,26 +0,0 @@ -@page "/IxCoreSequencer" -@using intergrations -@using ix.framework.core; -

IxCoreSequencer

- -
-
- Sequencer with few steps -
- -
-
- -RenderableContentControl Context="@Entry.Plc.ixcoreSequencers" Presentation="Command-Control" -
-
- -
-
- -RenderableContentControl Context="@Entry.Plc.ixcoreSequencers" Presentation="Status-Display" -
-
- -
-
diff --git a/src/integrations/integration.blazor/Program.cs b/src/integrations/integration.blazor/Program.cs index 5112f6d10..d55cd56a3 100644 --- a/src/integrations/integration.blazor/Program.cs +++ b/src/integrations/integration.blazor/Program.cs @@ -1,11 +1,11 @@ using integration.blazor.Data; using intergrations; using AXSharp.Connector; -using ix.framework.core.blazor.Toaster; +using AXOpen.Core.blazor.Toaster; using AXSharp.Presentation.Blazor.Services; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; -using ix.framework.core.DependencyInjection; +using AXOpen.Data.DependencyInjection; using static System.Formats.Asn1.AsnWriter; namespace integration.blazor @@ -33,10 +33,10 @@ public static void Main(string[] args) Entry.Plc.Connector.SubscriptionMode = AXSharp.Connector.ReadSubscriptionMode.Polling; - var repository = Ix.Repository.Json.Repository.Factory(new Ix.Framework.Data.Json.JsonRepositorySettings(Path.Combine(Environment.CurrentDirectory, "data", "processdata"))); - var repository2 = Ix.Repository.Json.Repository.Factory(new Ix.Framework.Data.Json.JsonRepositorySettings(Path.Combine(Environment.CurrentDirectory, "data", "testdata"))); + var repository = Ix.Repository.Json.Repository.Factory(new AXOpen.Data.Json.JsonRepositorySettings(Path.Combine(Environment.CurrentDirectory, "data", "processdata"))); + var repository2 = Ix.Repository.Json.Repository.Factory(new AXOpen.Data.Json.JsonRepositorySettings(Path.Combine(Environment.CurrentDirectory, "data", "testdata"))); //inherited IxProductionData - //var repository = Ix.Repository.Json.Repository.Factory(new Ix.Framework.Data.Json.JsonRepositorySettings(Path.Combine(Environment.CurrentDirectory, "data", "processdata"))); + //var repository = Ix.Repository.Json.Repository.Factory(new AXOpen.Data.Json.JsonRepositorySettings(Path.Combine(Environment.CurrentDirectory, "data", "processdata"))); // Entry.Plc.process_data_manager.InitializeRepository(repository); @@ -44,7 +44,7 @@ public static void Main(string[] args) Entry.Plc.MainContext.test_data_manager.InitializeRemoteDataExchange(repository2); - Entry.Plc.Integrations.DM.InitializeRemoteDataExchange(Ix.Repository.Json.Repository.Factory(new Ix.Framework.Data.Json.JsonRepositorySettings(Path.Combine(Environment.CurrentDirectory, "data", "processdata1")))); + Entry.Plc.Integrations.DM.InitializeRemoteDataExchange(Ix.Repository.Json.Repository.Factory(new AXOpen.Data.Json.JsonRepositorySettings(Path.Combine(Environment.CurrentDirectory, "data", "processdata1")))); var app = builder.Build(); @@ -66,7 +66,7 @@ public static void Main(string[] args) app.MapFallbackToPage("/_Host"); #region InitializeRemoteTask - Entry.Plc.ixcore_remote_tasks._remoteTask.Initialize(() => Console.WriteLine($"Remote task executed PLC sent this string: '{Entry.Plc.ixcore_remote_tasks._remoteTask.Message.GetAsync().Result}'")); + Entry.Plc.AxoRemoteTasks._remoteTask.Initialize(() => Console.WriteLine($"Remote task executed PLC sent this string: '{Entry.Plc.AxoRemoteTasks._remoteTask.Message.GetAsync().Result}'")); #endregion app.Run(); diff --git a/src/integrations/integration.blazor/Shared/MainLayout.razor b/src/integrations/integration.blazor/Shared/MainLayout.razor index d8b7d27a4..243b75a88 100644 --- a/src/integrations/integration.blazor/Shared/MainLayout.razor +++ b/src/integrations/integration.blazor/Shared/MainLayout.razor @@ -16,6 +16,6 @@ @Body - +
diff --git a/src/integrations/integration.blazor/Shared/NavMenu.razor b/src/integrations/integration.blazor/Shared/NavMenu.razor index fada89167..ee5a52392 100644 --- a/src/integrations/integration.blazor/Shared/NavMenu.razor +++ b/src/integrations/integration.blazor/Shared/NavMenu.razor @@ -23,28 +23,38 @@
+ +