private void button2_Click(object sender, EventArgs e) { if (fusionMotherboardInitialised) { Byte[] settingBuffer = constructArray(); textBox6.Text = "Update LED Settings: " + (FusionMotherboardWrapper.SetLedData(settingBuffer, settingBuffer.Length) == 0 ? "Success" : "Failure") + Environment.NewLine; textBox6.Text += "Apply Settings: " + (FusionMotherboardWrapper.Apply(-1) == 0 ? "Success" : "Failure") + Environment.NewLine; } if (fusionPeripheralsInitialised) { textBox6.Text += "Apply Peripheral Settings: " + (FusionPeripheralsWrapper.SetLed(-1, constructPeripArray((byte)int.Parse(textBox3.Text), (byte)int.Parse(textBox5.Text), (byte)int.Parse(textBox4.Text))) == 0 ? "Success" : "Failure"); } }
private void button1_Click(object sender, EventArgs e) { try { byte[] buf = new byte[16]; FusionMotherboardWrapper.GetSdkVersion(buf, buf.Length); textBox2.Text += "SDK Version: " + System.Text.Encoding.Unicode.GetString(buf).ToString() + Environment.NewLine; textBox1.Text += "API Init: " + (FusionMotherboardWrapper.InitAPI() == 0 ? "Success" : "Failure") + Environment.NewLine; maxDivision = FusionMotherboardWrapper.GetMaxDivision(); textBox1.Text += "Max No. of LED Zones: " + maxDivision.ToString() + Environment.NewLine; buf = new byte[maxDivision]; FusionMotherboardWrapper.GetLedLayout(buf, maxDivision); foreach (byte b in buf) { switch (b) { case 0: LedLayout.Add(LedTypes.NA); break; case 1: LedLayout.Add(LedTypes.A_LED); break; case 2: LedLayout.Add(LedTypes.D_LED_TYPE1); break; case 3: LedLayout.Add(LedTypes.D_LED_TYPE2); break; } } for (int i = 0; i < LedLayout.Count; i++) { textBox1.Text += "LED Zone " + i + ": " + LedLayout.ElementAt(i) + Environment.NewLine; } fusionMotherboardInitialised = true; } catch (Exception exc) { } try { int deviceCount; int[] deviceIdArray = new int[10]; FusionPeripheralsWrapper.InitAPI(out deviceCount, deviceIdArray); for (int i = 0; i < deviceCount; i++) { if (deviceIdArray[i] > 0 && deviceIdArray[i] < 20481) { textBox1.Text += "Peripheral " + i + ": " + (deviceIdArray[i] == 4097 ? "VGA" : "OTHER"); } } //Program.dllexp_GvLedSet(-1, new GVLED_CFG(1, 0, 0, 0, 0, 0, 10, 100/*colour*/, 0, 1, 1)); //THIS FUNCTION IS BROKEN //byte[] vgaName; //Program.dllexp_GvLedGetVgaModelName(out vgaName); //textBox6.Text = System.Text.Encoding.ASCII.GetString(vgaName); fusionPeripheralsInitialised = true; } catch (Exception exc) { } }