kopia lustrzana https://github.com/FreeSpacenav/spnavcfg
Porównaj commity
6 Commity
Autor | SHA1 | Data |
---|---|---|
Chris Mayo | 1850554b75 | |
John Tsiombikas | 7518e830c3 | |
John Tsiombikas | 4d0fd40f39 | |
John Tsiombikas | e9a11e97cc | |
Alberto Fanjul | 676cb8e5a6 | |
John Tsiombikas | fd9aa10fb8 |
|
@ -12,6 +12,8 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: FreeBSD build
|
||||
uses: vmactions/freebsd-vm@v0
|
||||
|
|
|
@ -12,6 +12,8 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
|
|
|
@ -12,10 +12,12 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
brew install qt@5
|
||||
brew install qt@5 pkg-config
|
||||
brew link qt@5 --force
|
||||
git clone https://github.com/FreeSpacenav/libspnav
|
||||
cd libspnav
|
||||
|
|
|
@ -2,7 +2,7 @@ csrc = $(wildcard src/*.c)
|
|||
ccsrc = $(wildcard src/*.cc)
|
||||
mochdr = src/ui.h
|
||||
mocsrc = $(mochdr:.h=.moc.cc)
|
||||
obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) $(mocsrc:.cc=.o) res.cc
|
||||
obj = $(sort $(csrc:.c=.o) $(ccsrc:.cc=.o) $(mocsrc:.cc=.o)) res.cc
|
||||
dep = $(csrc:.c=.d) $(ccsrc:.cc=.d)
|
||||
bin = spnavcfg
|
||||
|
||||
|
|
|
@ -82,6 +82,8 @@ int read_cfg(struct config *cfg)
|
|||
}
|
||||
}
|
||||
|
||||
cfg->repeat = spnav_cfg_get_repeat();
|
||||
|
||||
update_ui();
|
||||
return 0;
|
||||
}
|
||||
|
|
24
src/ui.cc
24
src/ui.cc
|
@ -162,6 +162,9 @@ bool MainWin::init()
|
|||
connect(ui->ed_serpath, SIGNAL(editingFinished()), this, SLOT(serpath_changed()));
|
||||
connect(ui->chk_serial, SIGNAL(stateChanged(int)), this, SLOT(chk_changed(int)));
|
||||
|
||||
connect(ui->chk_repeat, SIGNAL(stateChanged(int)), this, SLOT(chk_changed(int)));
|
||||
connect(ui->spin_repeat, SIGNAL(valueChanged(int)), this, SLOT(spin_changed(int)));
|
||||
|
||||
/*
|
||||
connect(ui->bn_loaddef, SIGNAL(clicked()), this, SLOT(bn_clicked()));
|
||||
connect(ui->bn_loadcfg, SIGNAL(clicked()), this, SLOT(bn_clicked()));
|
||||
|
@ -219,7 +222,7 @@ void MainWin::updateui()
|
|||
} else {
|
||||
ui->chk_serial->setChecked(false);
|
||||
}
|
||||
if(cfg.repeat > 0) {
|
||||
if(cfg.repeat >= 0) {
|
||||
ui->chk_repeat->setChecked(true);
|
||||
ui->spin_repeat->setValue(cfg.repeat);
|
||||
} else {
|
||||
|
@ -322,7 +325,7 @@ void MainWin::spnav_input()
|
|||
switch(ev.type) {
|
||||
case SPNAV_EVENT_MOTION:
|
||||
for(int i=0; i<6; i++) {
|
||||
if(abs(ev.motion.data[i] > maxval)) maxval = abs(ev.motion.data[i]);
|
||||
if(abs(ev.motion.data[i]) > maxval) maxval = abs(ev.motion.data[i]);
|
||||
}
|
||||
for(int i=0; i<6; i++) {
|
||||
prog_axis[i]->setMinimum(-maxval);
|
||||
|
@ -457,6 +460,13 @@ void MainWin::spin_changed(int val)
|
|||
if(mask_events) return;
|
||||
|
||||
QObject *src = QObject::sender();
|
||||
|
||||
if(src == ui->spin_repeat) {
|
||||
cfg.repeat = ui->spin_repeat->value();
|
||||
spnav_cfg_set_repeat(cfg.repeat);
|
||||
return;
|
||||
}
|
||||
|
||||
if(src == ui->spin_dead) {
|
||||
for(int i=0; i<devinfo.naxes; i++) {
|
||||
if(cfg.dead_thres[i] != val) {
|
||||
|
@ -492,6 +502,16 @@ void MainWin::chk_changed(int checked)
|
|||
free(cfg.serdev);
|
||||
cfg.serdev = 0;
|
||||
spnav_cfg_set_serial(cfg.serdev);
|
||||
return;
|
||||
}
|
||||
|
||||
if(src == ui->chk_repeat) {
|
||||
if(checked) {
|
||||
cfg.repeat = ui->spin_repeat->value();
|
||||
} else {
|
||||
cfg.repeat = -1;
|
||||
}
|
||||
spnav_cfg_set_repeat(cfg.repeat);
|
||||
}
|
||||
|
||||
if(src == ui->chk_swapyz) {
|
||||
|
|
|
@ -102,6 +102,11 @@
|
|||
<string>Disable translation</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dominant axis</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
Ładowanie…
Reference in New Issue