|
|
|
@ -431,12 +431,10 @@ char* philos_pard_array_add_cmd(char* cmd, temp_config* _config, char* key, int*
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
int philos_check_activ_disk(temp_set_window *widgets, temp_config* _config, int flag_check_array) {
|
|
|
|
|
int philos_check_activ_disk(temp_set_window *widgets, temp_config* _config, int size_disk) {
|
|
|
|
|
char* disk = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->cbtTempDevice));
|
|
|
|
|
disk = yon_char_divide_search(disk," ", -1);
|
|
|
|
|
int bool_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead));
|
|
|
|
|
int bool_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite));
|
|
|
|
|
if (disk == NULL || (_config->size_read == 0 && flag_check_array == 0) && (_config->size_write == 0 && flag_check_array==1)) {
|
|
|
|
|
if (disk == NULL || size_disk == 0) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -487,7 +485,7 @@ void philos_temp_generate_cmd(temp_set_window *widgets, temp_config* _config) {
|
|
|
|
|
str_cmd = philos_pard_array_add_cmd(str_cmd, _config, "IOReadBandwidthMax=", _config->i_o_limit_read, _config->i_o_limit_read_size, _config->disk_read, _config->size_read);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (_config->size_write!=0) {
|
|
|
|
|
if (_config->size_write!=0) {
|
|
|
|
|
str_cmd = philos_pard_array_add_cmd(str_cmd, _config, "IOWriteBandwidthMax=", _config->i_o_limit_write, _config->i_o_limit_write_size, _config->disk_write, _config->size_write);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -503,17 +501,21 @@ void philos_temp_del_disk(temp_set_window *widgets, temp_config* _config, int fl
|
|
|
|
|
int bool_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead));
|
|
|
|
|
int bool_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite));
|
|
|
|
|
char** ptr_disk = NULL;
|
|
|
|
|
int size = -1;
|
|
|
|
|
int size = 0;
|
|
|
|
|
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
ptr_disk = _config->disk_read;
|
|
|
|
|
size = _config->size_read;
|
|
|
|
|
if (philos_check_activ_disk(widgets, _config, size) == 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ptr_disk = _config->disk_read;
|
|
|
|
|
}
|
|
|
|
|
else if (flag_check_array == 1) {
|
|
|
|
|
ptr_disk = _config->disk_write;
|
|
|
|
|
size = _config->size_write;
|
|
|
|
|
}
|
|
|
|
|
if (philos_check_activ_disk(widgets, _config, flag_check_array) == 0) {
|
|
|
|
|
return;
|
|
|
|
|
if (philos_check_activ_disk(widgets, _config, size) == 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ptr_disk = _config->disk_write;
|
|
|
|
|
}
|
|
|
|
|
if (size) {
|
|
|
|
|
int index_find = -1;
|
|
|
|
@ -674,7 +676,7 @@ void philos_temp_add_disk(temp_set_window *widgets, temp_config* _config, int fl
|
|
|
|
|
int bool_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead));
|
|
|
|
|
int bool_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite));
|
|
|
|
|
char** ptr_disk = NULL;
|
|
|
|
|
int size = -1;
|
|
|
|
|
int size = 0;
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
ptr_disk = _config->disk_read;
|
|
|
|
|
size = _config->size_read;
|
|
|
|
@ -701,50 +703,58 @@ void philos_temp_add_disk(temp_set_window *widgets, temp_config* _config, int fl
|
|
|
|
|
// Добавление
|
|
|
|
|
ptr_disk = yon_char_parsed_append(ptr_disk,&size, disk);
|
|
|
|
|
size--;
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead))) {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite))) {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead))) {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
if (flag_check_array == 1) {
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite))) {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
size--;
|
|
|
|
|
size++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// Редактирование
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead))) {
|
|
|
|
|
_config->i_o_limit_read_size[index_find] =(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead));
|
|
|
|
|
_config->i_o_limit_read[index_find] = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_read_size[index_find] = -3;
|
|
|
|
|
_config->i_o_limit_read[index_find] = -3;
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite))) {
|
|
|
|
|
_config->i_o_limit_write_size[index_find] = (int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite));
|
|
|
|
|
_config->i_o_limit_write[index_find] = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite));
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead))) {
|
|
|
|
|
_config->i_o_limit_read_size[index_find] =(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead));
|
|
|
|
|
_config->i_o_limit_read[index_find] = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_read_size[index_find] = -3;
|
|
|
|
|
_config->i_o_limit_read[index_find] = -3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_write_size[index_find] = -3;
|
|
|
|
|
_config->i_o_limit_write[index_find] = -3;
|
|
|
|
|
if (flag_check_array == 1) {
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite))) {
|
|
|
|
|
_config->i_o_limit_write_size[index_find] = (int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite));
|
|
|
|
|
_config->i_o_limit_write[index_find] = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_write_size[index_find] = -3;
|
|
|
|
|
_config->i_o_limit_write[index_find] = -3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -753,29 +763,33 @@ void philos_temp_add_disk(temp_set_window *widgets, temp_config* _config, int fl
|
|
|
|
|
if (bool_read == 1 || bool_write == 1) {
|
|
|
|
|
ptr_disk = yon_char_parsed_append(ptr_disk,&size, disk);
|
|
|
|
|
size--;
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead))) {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite))) {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead))) {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
if (flag_check_array == 1) {
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite))) {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
size++;
|
|
|
|
|
}
|
|
|
|
|