sender
всегда cbFindModelMySql
private void comboBoxMySqlFilter(object sender, EventArgs e)
{
ComboBox comboBox = (ComboBox)sender;
string selectedValue = comboBox.SelectedItem?.ToString();
List<(ComboBox comboBox, string propertyName)> filterMappingsMySql = new List<(ComboBox, string)>
{
(cbFindServerMySql, "server"),
(cbFindModelMySql, "model"),
(cbFindOperatorMySql, "mobileoperator"),
};
foreach (var mapping in filterMappingsMySql)
{
if (sender is ComboBox cb && cb == mapping.comboBox)
{
List<deviceMySql> filteredDevices = deviceMySql.dgvDevices
.Where(d => d.GetType().GetProperty(mapping.propertyName)?
.GetValue(d)?.ToString() == cb.Text)
.ToList();
dgvMySql.DataSource = filteredDevices;
}
else
{
}
}
}
comboBoxMySqlFilter
private void comboBoxMySqlFilter(object sender, EventArgs e)
{
ComboBox comboBox = (ComboBox)sender;
string selectedValue = comboBox.SelectedItem?.ToString();
List<(ComboBox comboBox, string propertyName)> filterMappingsMySql = new List<(ComboBox, string)>
{
(cbFindServerMySql, "server"),
(cbFindModelMySql, "model"),
(cbFindOperatorMySql, "mobileoperator"),
};
foreach (var mapping in filterMappingsMySql)
{
if (sender is ComboBox cb && cb == mapping.comboBox)
{
List<deviceMySql> filteredDevices = deviceMySql.dgvDevices
.Where(d => d.GetType().GetProperty(mapping.propertyName)?
.GetValue(d)?.ToString() == cb.Text)
.ToList();
dgvMySql.DataSource = filteredDevices;
}
else
{
mapping.comboBox.Text = null;
}
}
}
devices.Add(device);
dgvDevices.Add((deviceMySql)device.MemberwiseClone());
import OPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.IN, pull_up_down=GPIO.PUD_UP)
try:
while True:
input_state = GPIO.input(7)
if input_state == GPIO.LOW:
print('Пин замкнут')
else:
print("ПИН РАЗОМКНУТ")
time.sleep(1)
except KeyboardInterrupt:
GPIO.cleanup()
const formData = new FormData();
formData.append('image', img);
formData.append('uploadUrlvk', data.response.upload_url);
console.log(formData);
const response = await fetch('http://localhost:3000/upload-image', {
method: 'POST',
headers: {
'Content-Type': 'multipart/form-data'
},
body: formData,
});
console.log(formData);
выдает объект formData с длинной 2, но на localhost:3000app.post('/upload-image', async (req, res) => {
const { image, uploadUrlvk } = req.body;
console.log(req.body);
[{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]
public void loadJsonDevice()
{
var devJson = new List<Device>();
foreach (var a in devices)
{
devJson.Add(a);
}
string jsonString = JsonSerializer.Serialize(devJson);
Console.WriteLine(jsonString);
}
Звук к материнской плате подключается шлейфом + pin питания, шлейф рабочий, а питание не смог проверить.
С ранее не работающими портами находятся minijack 3.5, там тоже нет звука как и со встроенных динамиков, но ПК распознает что были подключены наушники.