Example #1
0
        /// <summary>
        /// Configure MidInterpreter to parse all available Mids of a mode
        /// <para>Select Integrator if you're integrator or Controller if you're a controller</para>
        /// </summary>
        /// <param name="midInterpreter">MidInterpreter instance</param>
        /// <param name="mode">Are you the integrator or controller?</param>
        /// <returns></returns>
        public static MidInterpreter UseAllMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (mids.Any(x => !x.IsSubclassOf(typeof(Mid))))
            {
                throw new ArgumentException("All mids must inherit Mid class", nameof(mids));
            }

            return(midInterpreter
                   .UseAlarmMessages(mids.Where(x => DoesImplementInteface(x, typeof(Alarm.IAlarm))))
                   .UseApplicationControllerMessage(mids.Where(x => DoesImplementInteface(x, typeof(ApplicationController.IApplicationController))))
                   .UseApplicationSelectorMessages(mids.Where(x => DoesImplementInteface(x, typeof(ApplicationSelector.IApplicationSelector))))
                   .UseApplicationToolLocationSystemMessages(mids.Where(x => DoesImplementInteface(x, typeof(ApplicationToolLocationSystem.IApplicationToolLocationSystem))))
                   .UseAutomaticManualModeMessages(mids.Where(x => DoesImplementInteface(x, typeof(AutomaticManualMode.IAutomaticManualMode))))
                   .UseCommunicationMessages(mids.Where(x => DoesImplementInteface(x, typeof(Communication.ICommunication))))
                   .UseIOInterfaceMessages(mids.Where(x => DoesImplementInteface(x, typeof(IOInterface.IIOInterface))))
                   .UseJobMessages(mids.Where(x => DoesImplementInteface(x, typeof(Job.IJob))))
                   .UseAdvancedJobMessages(mids.Where(x => DoesImplementInteface(x, typeof(Job.Advanced.IAdvancedJob))))
                   .UseMotorTuningMessages(mids.Where(x => DoesImplementInteface(x, typeof(MotorTuning.IMotorTuning))))
                   .UseMultipleIdentifiersMessages(mids.Where(x => DoesImplementInteface(x, typeof(MultipleIdentifiers.IMultipleIdentifier))))
                   .UseMultiSpindleMessages(mids.Where(x => DoesImplementInteface(x, typeof(MultiSpindle.IMultiSpindle))))
                   .UseOpenProtocolCommandsDisabledMessages(mids.Where(x => DoesImplementInteface(x, typeof(OpenProtocolCommandsDisabled.IOpenProtocolCommandsDisabled))))
                   .UseParameterSetMessages(mids.Where(x => DoesImplementInteface(x, typeof(ParameterSet.IParameterSet))))
                   .UsePLCUserDataMessages(mids.Where(x => DoesImplementInteface(x, typeof(PLCUserData.IPLCUserData))))
                   .UsePowerMACSMessages(mids.Where(x => DoesImplementInteface(x, typeof(PowerMACS.IPowerMACS))))
                   .UseResultMessages(mids.Where(x => DoesImplementInteface(x, typeof(Result.IResult))))
                   .UseStatisticMessages(mids.Where(x => DoesImplementInteface(x, typeof(Statistic.IStatistic))))
                   .UseTighteningMessages(mids.Where(x => DoesImplementInteface(x, typeof(Tightening.ITightening))))
                   .UseTimeMessages(mids.Where(x => DoesImplementInteface(x, typeof(Time.ITime))))
                   .UseToolMessages(mids.Where(x => DoesImplementInteface(x, typeof(Tool.ITool))))
                   .UseUserInterfaceMessages(mids.Where(x => DoesImplementInteface(x, typeof(UserInterface.IUserInterface))))
                   .UseVinMessages(mids.Where(x => DoesImplementInteface(x, typeof(Vin.IVin)))));
        }
Example #2
0
 /// <summary>
 /// Configure MidInterpreter to parse all available Mids of a mode
 /// <para>Select Integrator if you're integrator or Controller if you're a controller</para>
 /// </summary>
 /// <param name="midInterpreter">MidInterpreter instance</param>
 /// <param name="mode">Are you the integrator or controller?</param>
 /// <returns></returns>
 public static MidInterpreter UseAllMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     return(midInterpreter
            .UseAlarmMessages(mode)
            .UseApplicationControllerMessage(mode)
            .UseApplicationSelectorMessages(mode)
            .UseApplicationToolLocationSystemMessages(mode)
            .UseAutomaticManualModeMessages(mode)
            .UseCommunicationMessages(mode)
            .UseIOInterfaceMessages(mode)
            .UseJobMessages(mode)
            .UseAdvancedJobMessages(mode)
            .UseMotorTuningMessages(mode)
            .UseMultipleIdentifiersMessages(mode)
            .UseMultiSpindleMessages(mode)
            .UseOpenProtocolCommandsDisabledMessages(mode)
            .UseParameterSetMessages(mode)
            .UsePLCUserDataMessages(mode)
            .UsePowerMACSMessages(mode)
            .UseResultMessages(mode)
            .UseStatisticMessages(mode)
            .UseTighteningMessages(mode)
            .UseTimeMessages(mode)
            .UseToolMessages(mode)
            .UseUserInterfaceMessages(mode)
            .UseVinMessages(mode));
 }
Example #3
0
        public static MidInterpreter UseAdvancedJobMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (!IsValid(mids, typeof(Job.Advanced.IAdvancedJob)))
            {
                throw new ArgumentException($"Types should inherit Mid class and must implement IAdvancedJob interface");
            }

            midInterpreter.UseTemplate <Job.Advanced.AdvancedJobMessages>(mids);
            return(midInterpreter);
        }
Example #4
0
        public static MidInterpreter UsePLCUserDataMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (!IsValid(mids, typeof(PLCUserData.IPLCUserData)))
            {
                throw new ArgumentException($"Types should inherit Mid class and must implement IPLCUserData interface");
            }

            midInterpreter.UseTemplate <PLCUserData.PLCUserDataMessages>(mids);
            return(midInterpreter);
        }
Example #5
0
        public static MidInterpreter UseVinMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (!IsValid(mids, typeof(Vin.IVin)))
            {
                throw new ArgumentException($"Types should inherit Mid class and must implement IVin interface");
            }

            midInterpreter.UseTemplate <Vin.VinMessages>(mids);
            return(midInterpreter);
        }
Example #6
0
        public static MidInterpreter UseAutomaticManualModeMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (!IsValid(mids, typeof(AutomaticManualMode.IAutomaticManualMode)))
            {
                throw new ArgumentException($"Types should inherit Mid class and must implement IAutomaticManualMode interface");
            }

            midInterpreter.UseTemplate <AutomaticManualMode.AutomaticManualModeMessages>(mids);
            return(midInterpreter);
        }
Example #7
0
        public static MidInterpreter UseApplicationToolLocationSystemMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (!IsValid(mids, typeof(ApplicationToolLocationSystem.IApplicationToolLocationSystem)))
            {
                throw new ArgumentException($"Types should inherit Mid class and must implement IApplicationToolLocationSystem interface");
            }

            midInterpreter.UseTemplate <ApplicationToolLocationSystem.ApplicationToolLocationSystemMessages>(mids);
            return(midInterpreter);
        }
Example #8
0
        public static MidInterpreter UseMultiSpindleMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (!IsValid(mids, typeof(MultiSpindle.IMultiSpindle)))
            {
                throw new ArgumentException($"Types should inherit Mid class and implement IMultiSpindle interface");
            }

            midInterpreter.UseTemplate <MultiSpindle.MultiSpindleMessages>(mids);
            return(midInterpreter);
        }
Example #9
0
        public static MidInterpreter UseOpenProtocolCommandsDisabledMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (!IsValid(mids, typeof(OpenProtocolCommandsDisabled.IOpenProtocolCommandsDisabled)))
            {
                throw new ArgumentException($"Types should inherit Mid class and must implement IOpenProtocolCommandsDisabled interface");
            }

            midInterpreter.UseTemplate <OpenProtocolCommandsDisabled.OpenProtocolCommandsDisabledMessages>(mids);
            return(midInterpreter);
        }
Example #10
0
        public static MidInterpreter UseAlarmMessages(this MidInterpreter midInterpreter, IEnumerable <Type> mids)
        {
            if (mids.Any())
            {
                if (!IsValid(mids, typeof(Alarm.IAlarm)))
                {
                    throw new ArgumentException($"Types should inherit Mid class and must implement IAlarm interface");
                }

                midInterpreter.UseTemplate <Alarm.AlarmMessages>(mids);
            }
            return(midInterpreter);
        }
Example #11
0
 public static MidInterpreter UseApplicationSelectorMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <ApplicationSelector.ApplicationSelectorMessages>(mode);
     return(midInterpreter);
 }
Example #12
0
 public static MidInterpreter UseAutomaticManualModeMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <AutomaticManualMode.AutomaticManualModeMessages>(mode);
     return(midInterpreter);
 }
Example #13
0
 public static MidInterpreter UseAlarmMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <Alarm.AlarmMessages>(mode);
     return(midInterpreter);
 }
Example #14
0
 public static MidInterpreter UseUserInterfaceMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <UserInterface.UserInterfaceMessages>(mode);
     return(midInterpreter);
 }
Example #15
0
 public static MidInterpreter UseCommunicationMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <Communication.CommunicationMessages>(mode);
     return(midInterpreter);
 }
Example #16
0
 public static MidInterpreter UseStatisticMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <Statistic.StatisticMessages>(mode);
     return(midInterpreter);
 }
Example #17
0
 public static MidInterpreter UseTighteningMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <Tightening.TighteningMessages>(mode);
     return(midInterpreter);
 }
Example #18
0
 public static MidInterpreter UsePowerMACSMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <PowerMACS.PowerMACSMessages>(mode);
     return(midInterpreter);
 }
Example #19
0
 public static MidInterpreter UseResultMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <Result.ResultMessages>(mode);
     return(midInterpreter);
 }
Example #20
0
 public static MidInterpreter UsePLCUserDataMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <PLCUserData.PLCUserDataMessages>(mode);
     return(midInterpreter);
 }
Example #21
0
 public static MidInterpreter UseAdvancedJobMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <Job.Advanced.AdvancedJobMessages>(mode);
     return(midInterpreter);
 }
Example #22
0
 public static MidInterpreter UseParameterSetMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <ParameterSet.ParameterSetMessages>(mode);
     return(midInterpreter);
 }
Example #23
0
 public static MidInterpreter UseApplicationToolLocationSystemMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <ApplicationToolLocationSystem.ApplicationToolLocationSystemMessages>(mode);
     return(midInterpreter);
 }
Example #24
0
 public static MidInterpreter UseOpenProtocolCommandsDisabledMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <OpenProtocolCommandsDisabled.OpenProtocolCommandsDisabledMessages>(mode);
     return(midInterpreter);
 }
Example #25
0
 public static MidInterpreter UseMultipleIdentifiersMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <MultipleIdentifiers.MultipleIdentifierMessages>(mode);
     return(midInterpreter);
 }
Example #26
0
 public static MidInterpreter UseMultiSpindleMessages(this MidInterpreter midInterpreter, InterpreterMode mode = InterpreterMode.Both)
 {
     midInterpreter.UseTemplate <MultiSpindle.MultiSpindleMessages>(mode);
     return(midInterpreter);
 }