예제 #1
0
        public override string GetDeviceSubTypeStr(DeviceType dt,
                                                   DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.LT:
                switch (dst)
                {
                case DeviceSubType.LT:
                    return("LT");

                case DeviceSubType.LT_IOLINK:
                    return("LT_IOLINK");

                case DeviceSubType.LT_CONE:
                    return("LT_CONE");

                case DeviceSubType.LT_CYL:
                    return("LT_CYL");

                case DeviceSubType.LT_TRUNC:
                    return("LT_TRUNC");

                case DeviceSubType.LT_VIRT:
                    return("LT_VIRT");
                }
                break;
            }
            return("");
        }
        public override Capacity GetCapacity(ControlProcessorHardware cph, DeviceSubType deviceSubType)
        {
            if (cph.ModuleType != HardwareModuleType.Button)
            {
                return new Capacity {
                           DeviceSubtypeIsNotSuitableForCurrentHardware = true
                }
            }
            ;

            switch (deviceSubType)
            {
            case DeviceSubType.Motherboard:
                return(new Capacity {
                    Names = GetConnectedDevices().ToArray()
                });

            case DeviceSubType.Control:
                return(new Capacity {
                    Names = Enumerable.Range(0, 255).ToArray().Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray()
                });

            default:
                return(new Capacity {
                    DeviceSubtypeIsNotSuitableForCurrentHardware = true
                });
            }
        }
    }
예제 #3
0
파일: LS.cs 프로젝트: radtek/EasyEPLANner
        public override List <string> GetDeviceProperties(DeviceType dt,
                                                          DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.LS:
                switch (dst)
                {
                case DeviceSubType.LS_MIN:
                case DeviceSubType.LS_MAX:
                case DeviceSubType.LS_VIRT:
                    return(new List <string>(new string[]
                    {
                        "ST",
                        "M",
                        "P_DT"
                    }));

                case DeviceSubType.LS_IOLINK_MIN:
                case DeviceSubType.LS_IOLINK_MAX:
                    return(new List <string>(new string[]
                    {
                        "ST",
                        "M",
                        "V"
                    }));
                }
                break;
            }
            return(null);
        }
예제 #4
0
        public override Dictionary <string, int> GetDeviceProperties(
            DeviceType dt, DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.AO:
                switch (dst)
                {
                case DeviceSubType.AO:
                    return(new Dictionary <string, int>()
                    {
                        { "M", 1 },
                        { "V", 1 },
                        { "P_MIN_V", 1 },
                        { "P_MAX_V", 1 },
                    });

                case DeviceSubType.AO_VIRT:
                    return(new Dictionary <string, int>()
                    {
                        { "M", 1 },
                        { "V", 1 },
                    });
                }
                break;
            }
            return(null);
        }
예제 #5
0
 public override Dictionary <string, int> GetDeviceProperties(
     DeviceType dt, DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.F:
         switch (dst)
         {
         case DeviceSubType.F:
             return(new Dictionary <string, int>()
             {
                 { "M", 1 },
                 { "V", 1 },
                 { "ST", 1 },
                 { "ERR", 1 },
                 { "ST_CH", 4 },
                 { "NOMINAL_CURRENT", 4 },
                 { "LOAD_CURRENT", 4 },
                 { "ERR_CH", 4 },
             });
         }
         break;
     }
     return(null);
 }
예제 #6
0
파일: LS.cs 프로젝트: as005408/EasyEPLANner
        public override string GetDeviceSubTypeStr(DeviceType dt,
                                                   DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.LS:
                switch (dst)
                {
                case DeviceSubType.LS_MIN:
                    return("LS_MIN");

                case DeviceSubType.LS_MAX:
                    return("LS_MAX");

                case DeviceSubType.LS_IOLINK_MIN:
                    return("LS_IOLINK_MIN");

                case DeviceSubType.LS_IOLINK_MAX:
                    return("LS_IOLINK_MAX");

                case DeviceSubType.LS_VIRT:
                    return("LS_VIRT");
                }
                break;
            }
            return("");
        }
예제 #7
0
        public override Capacity GetCapacity(ControlProcessorHardware cph, DeviceSubType deviceSubType)
        {
            if (deviceSubType == DeviceSubType.Motherboard && (cph.ModuleType == HardwareModuleType.Button || cph.ModuleType == HardwareModuleType.Axis))
            {
                return new Capacity {
                           Names = GetConnectedDevices().ToArray()
                }
            }
            ;
            if (cph.ModuleType == HardwareModuleType.Axis && deviceSubType == DeviceSubType.Control)
            {
                return new Capacity {
                           Names = Enumerable.Range(0, ((JoystickDevice)Devices[cph.MotherBoardId]).GetCapabilities().AxesCount).ToArray().Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray()
                }
            }
            ;
            if (cph.ModuleType == HardwareModuleType.Button && deviceSubType == DeviceSubType.Control)
            {
                return new Capacity {
                           Names = Enumerable.Range(0, ((JoystickDevice)Devices[cph.MotherBoardId]).GetCapabilities().ButtonCount).ToArray().Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray()
                }
            }
            ;
            return(new Capacity {
                DeviceSubtypeIsNotSuitableForCurrentHardware = true
            });
        }
    }
}
예제 #8
0
파일: AI.cs 프로젝트: radtek/EasyEPLANner
        public override List <string> GetDeviceProperties(DeviceType dt,
                                                          DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.AI:
                switch (dst)
                {
                case DeviceSubType.AI:
                    return(new List <string>(new string[]
                    {
                        "M",
                        "ST",
                        "P_MIN_V",
                        "P_MAX_V",
                        "V"
                    }));

                case DeviceSubType.AI_VIRT:
                    return(new List <string>(new string[]
                    {
                        "M",
                        "ST",
                        "V"
                    }));
                }
                break;
            }
            return(null);
        }
예제 #9
0
        public override string GetDeviceSubTypeStr(DeviceType dt,
                                                   DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.V:
                switch (dst)
                {
                case DeviceSubType.V_DO1:
                    return("V_DO1");

                case DeviceSubType.V_DO2:
                    return("V_DO2");

                case DeviceSubType.V_DO1_DI1_FB_OFF:
                    return("V_DO1_DI1_FB_OFF");

                case DeviceSubType.V_DO1_DI1_FB_ON:
                    return("V_DO1_DI1_FB_ON");

                case DeviceSubType.V_DO1_DI2:
                    return("V_DO1_DI2");

                case DeviceSubType.V_DO2_DI2:
                    return("V_DO2_DI2");

                case DeviceSubType.V_MIXPROOF:
                    return("V_MIXPROOF");

                case DeviceSubType.V_IOLINK_MIXPROOF:
                    return("V_IOLINK_MIXPROOF");

                case DeviceSubType.V_AS_MIXPROOF:
                    return("V_AS_MIXPROOF");

                case DeviceSubType.V_BOTTOM_MIXPROOF:
                    return("V_BOTTOM_MIXPROOF");

                case DeviceSubType.V_AS_DO1_DI2:
                    return("V_AS_DO1_DI2");

                case DeviceSubType.V_IOLINK_DO1_DI2:
                    return("V_IOLINK_DO1_DI2");

                case DeviceSubType.V_DO2_DI2_BISTABLE:
                    return("V_DO2_DI2_BISTABLE");

                case DeviceSubType.V_IOLINK_VTUG_DO1:
                    return("V_IOLINK_VTUG_DO1");

                case DeviceSubType.V_IOLINK_VTUG_DO1_FB_OFF:
                    return("V_IOLINK_VTUG_DO1_FB_OFF");

                case DeviceSubType.V_IOLINK_VTUG_DO1_FB_ON:
                    return("V_IOLINK_VTUG_DO1_FB_ON");
                }
                break;
            }
            return("");
        }
예제 #10
0
파일: LS.cs 프로젝트: as005408/EasyEPLANner
        public override Dictionary <string, int> GetDeviceProperties(
            DeviceType dt, DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.LS:
                switch (dst)
                {
                case DeviceSubType.LS_MIN:
                case DeviceSubType.LS_MAX:
                case DeviceSubType.LS_VIRT:
                    return(new Dictionary <string, int>()
                    {
                        { "ST", 1 },
                        { "M", 1 },
                        { "P_DT", 1 },
                    });

                case DeviceSubType.LS_IOLINK_MIN:
                case DeviceSubType.LS_IOLINK_MAX:
                    return(new Dictionary <string, int>()
                    {
                        { "ST", 1 },
                        { "M", 1 },
                        { "V", 1 },
                    });
                }
                break;
            }
            return(null);
        }
 internal void __MarshalFrom(ref Capabilities.__Native @ref)
 {
     this.Type    = @ref.Type;
     this.SubType = @ref.SubType;
     this.Flags   = @ref.Flags;
     this.Gamepad = @ref.Gamepad;
     this.Vibration.__MarshalFrom(ref @ref.Vibration);
 }
예제 #12
0
 private void ParseCapabilities()
 {
     if (!string.IsNullOrEmpty(description.capabilities))
     {
         var capabilities = JsonUtility.FromJson <Capabilities>(description.capabilities);
         m_SubType = capabilities.subType;
     }
     m_HaveParsedCapabilities = true;
 }
예제 #13
0
        public override List <string> GetDeviceProperties(DeviceType dt,
                                                          DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.M:
                switch (dst)
                {
                case DeviceSubType.M:
                    return(new List <string>(new string[]
                    {
                        "ST",
                        "M",
                        "P_ON_TIME",
                    }));

                case DeviceSubType.M_FREQ:
                    return(new List <string>(new string[]
                    {
                        "ST",
                        "M",
                        "P_ON_TIME",
                        "V"
                    }));

                case DeviceSubType.M_REV:
                case DeviceSubType.M_REV_FREQ:
                case DeviceSubType.M_REV_2:
                case DeviceSubType.M_REV_FREQ_2:
                case DeviceSubType.M_REV_2_ERROR:
                    return(new List <string>(new string[]
                    {
                        "ST",
                        "M",
                        "P_ON_TIME",
                        "V",
                        "R"
                    }));

                case DeviceSubType.M_ATV:
                    return(new List <string>(new string[]
                    {
                        "M",
                        "ST",
                        "R",
                        "FRQ",
                        "RPM",
                        "EST",
                        "V",
                        "P_ON_TIME"
                    }));
                }
                break;
            }
            return(null);
        }
예제 #14
0
        public override Dictionary <string, int> GetDeviceProperties(
            DeviceType dt, DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.M:
                switch (dst)
                {
                case DeviceSubType.M:
                    return(new Dictionary <string, int>()
                    {
                        { "ST", 1 },
                        { "M", 1 },
                        { "P_ON_TIME", 1 },
                    });

                case DeviceSubType.M_FREQ:
                    return(new Dictionary <string, int>()
                    {
                        { "ST", 1 },
                        { "M", 1 },
                        { "P_ON_TIME", 1 },
                        { "V", 1 },
                    });

                case DeviceSubType.M_REV:
                case DeviceSubType.M_REV_FREQ:
                case DeviceSubType.M_REV_2:
                case DeviceSubType.M_REV_FREQ_2:
                case DeviceSubType.M_REV_2_ERROR:
                    return(new Dictionary <string, int>()
                    {
                        { "ST", 1 },
                        { "M", 1 },
                        { "P_ON_TIME", 1 },
                        { "V", 1 },
                        { "R", 1 },
                    });

                case DeviceSubType.M_ATV:
                    return(new Dictionary <string, int>()
                    {
                        { "M", 1 },
                        { "ST", 1 },
                        { "R", 1 },
                        { "FRQ", 1 },
                        { "RPM", 1 },
                        { "EST", 1 },
                        { "V", 1 },
                        { "P_ON_TIME", 1 },
                    });
                }
                break;
            }
            return(null);
        }
예제 #15
0
 /// <summary>
 /// Получение свойств устройства.
 /// </summary>
 public virtual List <string> GetDeviceProperties(DeviceType dt,
                                                  DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.NONE:
         return(null);
     }
     return(null);
 }
예제 #16
0
 /// <summary>
 /// Получение строкового представления подтипа устройства.
 /// </summary>
 public virtual string GetDeviceSubTypeStr(DeviceType dt,
                                           DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.NONE:
         return(dt.ToString());
     }
     return("");
 }
예제 #17
0
 public override string GetDeviceSubTypeStr(DeviceType dt,
                                            DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.WT:
         return(dt.ToString());
     }
     return("");
 }
예제 #18
0
 /// <summary>
 /// Получение свойств устройства.
 /// String - название тэга
 /// Int - количество повторений (размерность). Дефолт - 1.
 /// </summary>
 /// <param name="dst">Подтип устройства</param>
 /// <param name="dt">Тип устройства</param>
 public virtual Dictionary <string, int> GetDeviceProperties(
     DeviceType dt, DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.NONE:
         return(null);
     }
     return(null);
 }
예제 #19
0
        /// <summary>
        /// Get an instrument object with default settings based on device type and/or sub type.
        /// </summary>
        internal static Instrument GetInstrumentForTest(DeviceType deviceType, DeviceSubType deviceSubType = DeviceSubType.None)
        {
            Instrument instrument = new Instrument("TSTINST-001");

            instrument.Type            = deviceType;
            instrument.Subtype         = deviceSubType;
            instrument.SoftwareVersion = "1.10.01";

            instrument.BumpTimeout = 10;
            return(instrument);
        }
예제 #20
0
 public override Dictionary <string, int> GetDeviceProperties(
     DeviceType dt, DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.HA:
         return(new Dictionary <string, int>()
         {
             { "ST", 1 },
             { "M", 1 },
         });
     }
     return(null);
 }
예제 #21
0
 public override List <string> GetDeviceProperties(DeviceType dt,
                                                   DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.HA:
         return(new List <string>(new string[]
         {
             "ST",
             "M"
         }));
     }
     return(null);
 }
예제 #22
0
 public override string GetDeviceSubTypeStr(DeviceType dt,
                                            DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.F:
         switch (dst)
         {
         case DeviceSubType.F:
             return("F");
         }
         break;
     }
     return("");
 }
예제 #23
0
        public override Dictionary <string, int> GetDeviceProperties(
            DeviceType dt, DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.QT:
                switch (dst)
                {
                case DeviceSubType.QT:
                    return(new Dictionary <string, int>()
                    {
                        { "ST", 1 },
                        { "M", 1 },
                        { "V", 1 },
                        { "P_MIN_V", 1 },
                        { "P_MAX_V", 1 },
                        { "P_CZ", 1 },
                    });

                case DeviceSubType.QT_OK:
                    return(new Dictionary <string, int>()
                    {
                        { "ST", 1 },
                        { "M", 1 },
                        { "V", 1 },
                        { "OK", 1 },
                        { "P_MIN_V", 1 },
                        { "P_MAX_V", 1 },
                        { "P_CZ", 1 },
                    });

                case DeviceSubType.QT_IOLINK:
                    return(new Dictionary <string, int>()
                    {
                        { "ST", 1 },
                        { "M", 1 },
                        { "V", 1 },
                        { "P_CZ", 1 },
                        { "T", 1 },
                        { "P_ERR", 1 },
                    });
                }
                break;
            }
            return(null);
        }
예제 #24
0
        /// <summary>
        /// Получить информацию о возможностях устройства
        /// </summary>
        /// <param name="cph"></param>
        /// <param name="deviceSubType"></param>
        public static Capacity GetCapacity(ControlProcessorHardware cph, DeviceSubType deviceSubType)
        {
            if (deviceSubType != DeviceSubType.Motherboard)
            {
                foreach (var hardware in Hardwares.Where(hardware => hardware.GetConnectedDevices().Contains(cph.MotherBoardId)))
                {
                    return(hardware.GetCapacity(cph, deviceSubType));
                }
            }
            var capacity = new Capacity();

            foreach (var c in Hardwares.Select(hardware => hardware.GetCapacity(cph, deviceSubType)))
            {
                capacity.Add(c);
            }
            return(capacity);
        }
예제 #25
0
파일: QT.cs 프로젝트: radtek/EasyEPLANner
        public override List <string> GetDeviceProperties(DeviceType dt,
                                                          DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.QT:
                switch (dst)
                {
                case DeviceSubType.QT:
                    return(new List <string>(new string[]
                    {
                        "ST",
                        "M",
                        "V",
                        "P_MIN_V",
                        "P_MAX_V",
                        "P_CZ"
                    }));

                case DeviceSubType.QT_OK:
                    return(new List <string>(new string[]
                    {
                        "ST",
                        "M",
                        "V",
                        "OK",
                        "P_MIN_V",
                        "P_MAX_V",
                        "P_CZ"
                    }));

                case DeviceSubType.QT_IOLINK:
                    return(new List <string>(new string[]
                    {
                        "ST",
                        "M",
                        "V",
                        "P_CZ",
                        "T",
                    }));
                }
                break;
            }
            return(null);
        }
예제 #26
0
파일: TE.cs 프로젝트: radtek/EasyEPLANner
        public override string GetDeviceSubTypeStr(DeviceType dt,
                                                   DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.TE:
                switch (dst)
                {
                case DeviceSubType.TE:
                    return("TE");

                case DeviceSubType.TE_IOLINK:
                    return("TE_IOLINK");
                }
                break;
            }
            return("");
        }
예제 #27
0
        public override string GetDeviceSubTypeStr(DeviceType dt,
                                                   DeviceSubType dst)
        {
            switch (dt)
            {
            case DeviceType.AO:
                switch (dst)
                {
                case DeviceSubType.AO:
                    return("AO");

                case DeviceSubType.AO_VIRT:
                    return("AO_VIRT");
                }
                break;
            }
            return("");
        }
예제 #28
0
 public override Dictionary <string, int> GetDeviceProperties(
     DeviceType dt, DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.WT:
         return(new Dictionary <string, int>()
         {
             { "ST", 1 },
             { "M", 1 },
             { "V", 1 },
             { "P_NOMINAL_W", 1 },
             { "P_DT", 1 },
             { "P_RKP", 1 },
             { "P_CZ", 1 },
         });
     }
     return(null);
 }
예제 #29
0
파일: WT.cs 프로젝트: radtek/EasyEPLANner
 public override List <string> GetDeviceProperties(DeviceType dt,
                                                   DeviceSubType dst)
 {
     switch (dt)
     {
     case DeviceType.WT:
         return(new List <string>(new string[]
         {
             "ST",
             "M",
             "V",
             "P_NOMINAL_W",
             "P_DT",
             "P_RKP",
             "P_CZ"
         }));
     }
     return(null);
 }
        private void RememberSelectedItemOnOpenCombobox(ComboBox cb, DeviceSubType deviceSubType)
        {
            _selectedItemOfOpenedCombobox = (string)cb.SelectedItem;
            var cph = new ControlProcessorHardware
            {
                ModuleType    = _hardwareSupported,
                MotherBoardId = (string)_motherboardList.SelectedItem,
                BlockId       = uint.Parse(string.IsNullOrEmpty((string)_blockId.SelectedItem) ? "0" : (string)_blockId.SelectedItem),
                ModuleId      = uint.Parse(string.IsNullOrEmpty((string)_moduleList.SelectedItem) ? "0" : (string)_moduleList.SelectedItem),
                ControlId     = uint.Parse(string.IsNullOrEmpty((string)_controlId.SelectedItem) ? "0" : (string)_controlId.SelectedItem),
            };

            cb.Items.Clear();
            var capacity = HardwareManager.GetCapacity(cph, deviceSubType).Names;

            foreach (var c in capacity)
            {
                cb.Items.Add(c);
            }
        }