Пример #1
0
 public List <string> getColors()
 {
     if (disable)
     {
         return(null);
     }
     return(Lights.getDetailsFor(2));
 }
Пример #2
0
 public List <string> getNames()
 {
     if (disable)
     {
         return(null);
     }
     return(Lights.getDetailsFor(0));
 }
Пример #3
0
 public List <string> getPositions()
 {
     if (disable)
     {
         return(null);
     }
     return(Lights.getDetailsFor(1));
 }
Пример #4
0
        public static int addDevice(string lightName, string ColorCSV)
        {
            string[]        components = ColorCSV.Split(',');
            LFX_ColorStruct color      = new LFX_ColorStruct(Convert.ToByte(components[0]), Convert.ToByte(components[1]), Convert.ToByte(components[2]), Convert.ToByte(components[3]));
            LightDevice     device     = Lights.getLightForName(lightName) as LightDevice;

            device.LightColor = color;
            lights.Add(device);
            return(0);
        }
Пример #5
0
        public void InitializeAFX()
        {
            lightFXController = new LightFXController();
            LFX_Result status = lightFXController.LFX_Initialize();

            Console.WriteLine("Initializing Alien FX System");
            switch (status)
            {
            case LFX_Result.LFX_Success:
            {
                Console.WriteLine("Initialization Successful");
                lightFXController.LFX_Reset();
                lightFXController.LFX_GetNumLights(AFX_Device, out AFX_Lights_Count);
                Lights lights = new Lights();
                for (int i = 0; i < AFX_Lights_Count; i++)
                {
                    StringBuilder sb = new StringBuilder();
                    lightFXController.LFX_GetLightDescription(AFX_Device, Convert.ToUInt32(i), out sb, 255);
                    string       name = sb.ToString();
                    LFX_Position position;
                    lightFXController.LFX_GetLightLocation(AFX_Device, Convert.ToUInt32(i), out position);
                    LFX_ColorStruct color;
                    lightFXController.LFX_GetLightColor(AFX_Device, Convert.ToUInt32(i), out color);
                    LightDevice device = new LightDevice(Convert.ToUInt32(i), name, position, color);
                    Lights.addDevice(device);
                }
            }
            break;

            case LFX_Result.LFX_Failure:
            {
                disable = true;
                Console.WriteLine("Error Occured During Initialization.");
            }
            break;

            default:
            {
                disable = true;
                Console.WriteLine("Not An Alien FX Equipped Machine");
            }
            break;
            }
        }