示例#1
0
        public ZpiObject(CommandSubsystem commandSubsystem, byte cmdId)
        {
            CommandSubsystem = commandSubsystem;
            CommandId        = cmdId;

            ZpiObject zpi = ZpiMeta.GetCommand(commandSubsystem, cmdId);

            if (zpi != null)
            {
                this.Type             = zpi.Type;
                this.Name             = zpi.Name;
                this.RequestArguments = zpi.RequestArguments;
            }
        }
示例#2
0
        public ZpiSREQ(CommandSubsystem subSystem, byte cmdId)
        {
            CommandSubsystem = subSystem;
            CommandId        = cmdId;

            ZpiObject zpi = ZpiMeta.GetCommand(subSystem, cmdId);

            if (zpi != null)
            {
                this.Type             = zpi.Type;
                this.Name             = zpi.Name;
                this.RequestArguments = zpi.RequestArguments;
                if (zpi is ZpiSREQ)
                {
                    this.ResponseArguments = ((ZpiSREQ)zpi).ResponseArguments;
                }
            }
        }
示例#3
0
 public void Response(ZpiObject zpiObject)
 {
     OnResponse?.Invoke(this, zpiObject);
 }
示例#4
0
 public void Parsed(ZpiObject zpiObject)
 {
     OnParsed?.Invoke(this, zpiObject);
 }
示例#5
0
 public static T ToSpecificObject<T>(this ZpiObject zpiObject) where T : ZpiObject
 {
     return (T)Activator.CreateInstance(typeof(T), zpiObject);
 }
示例#6
0
 public ZpiSREQ(ZpiObject zpiObject)
     : this(zpiObject.CommandSubsystem, zpiObject.CommandId)
 {
     Type             = zpiObject.Type;
     RequestArguments = zpiObject.RequestArguments;
 }