Skip to content

Commit

Permalink
Merge pull request #4 from HakaiInstitute/bug-fixes
Browse files Browse the repository at this point in the history
Fix UI inconsistencies on windows
  • Loading branch information
tayden authored Aug 3, 2023
2 parents aed3fa7 + ff637d8 commit ddbd141
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 43 deletions.
4 changes: 2 additions & 2 deletions las_trx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class TransformConfig(BaseModel):
s_coords: Union[enums.CoordType, str]
t_coords: Union[enums.CoordType, str]

@classmethod
@field_validator("s_epoch", "t_epoch")
def check_decimal_date(
@classmethod
def date2decimal(
cls, v: Union[float, date], info: FieldValidationInfo
) -> float:
if isinstance(v, float):
Expand Down
119 changes: 84 additions & 35 deletions las_trx/resources/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>611</width>
<height>789</height>
<width>600</width>
<height>780</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -32,12 +32,6 @@ color: rgb(143, 240, 164)</string>
<property name="styleSheet">
<string notr="true">background-color: rgb(36, 31, 49);</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_input">
Expand All @@ -50,6 +44,7 @@ color: rgb(143, 240, 164)</string>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand Down Expand Up @@ -88,7 +83,17 @@ color: rgb(143, 240, 164)</string>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_input_file"/>
<widget class="QLineEdit" name="lineEdit_input_file">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_input_file">
Expand Down Expand Up @@ -164,6 +169,9 @@ color: rgb(143, 240, 164)</string>
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<property name="minimum">
<number>7</number>
</property>
Expand All @@ -177,6 +185,9 @@ color: rgb(143, 240, 164)</string>
</item>
<item row="5" column="0">
<widget class="QComboBox" name="comboBox_input_coordinates">
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<property name="currentIndex">
<number>2</number>
</property>
Expand All @@ -199,6 +210,9 @@ color: rgb(143, 240, 164)</string>
</item>
<item row="1" column="0">
<widget class="QComboBox" name="comboBox_input_reference">
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<property name="currentText">
<string>WGS84</string>
</property>
Expand Down Expand Up @@ -289,6 +303,9 @@ color: rgb(143, 240, 164)</string>
</item>
<item row="1" column="1">
<widget class="QDateEdit" name="dateEdit_input_epoch">
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<property name="time">
<time>
<hour>8</hour>
Expand All @@ -303,7 +320,7 @@ color: rgb(143, 240, 164)</string>
<second>59</second>
<year>9998</year>
<month>1</month>
<day>14</day>
<day>15</day>
</datetime>
</property>
<property name="displayFormat">
Expand Down Expand Up @@ -376,6 +393,9 @@ color: rgb(143, 240, 164)</string>
</item>
<item row="7" column="0">
<widget class="QComboBox" name="comboBox_input_vertical_reference">
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<item>
<property name="text">
<string>WGS84</string>
Expand All @@ -397,12 +417,6 @@ color: rgb(143, 240, 164)</string>
<property name="styleSheet">
<string notr="true">background-color: rgb(36, 31, 49)</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_output">
Expand All @@ -415,6 +429,7 @@ color: rgb(143, 240, 164)</string>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand Down Expand Up @@ -450,7 +465,14 @@ color: rgb(143, 240, 164)</string>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_output_file"/>
<widget class="QLineEdit" name="lineEdit_output_file">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_output_file">
Expand All @@ -462,6 +484,16 @@ color: rgb(143, 240, 164)</string>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_epoch_trans">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Epoch Transformation</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_output_options" native="true">
<layout class="QGridLayout" name="gridLayout_2">
Expand Down Expand Up @@ -489,6 +521,9 @@ color: rgb(143, 240, 164)</string>
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<item>
<property name="text">
<string>NAD83(CSRS)</string>
Expand Down Expand Up @@ -606,6 +641,9 @@ color: rgb(143, 240, 164)</string>
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<property name="minimum">
<number>7</number>
</property>
Expand All @@ -625,6 +663,21 @@ color: rgb(143, 240, 164)</string>
<property name="enabled">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<property name="wrapping">
<bool>false</bool>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectToPreviousValue</enum>
</property>
<property name="keyboardTracking">
<bool>true</bool>
</property>
<property name="time">
<time>
<hour>8</hour>
Expand Down Expand Up @@ -652,6 +705,9 @@ color: rgb(143, 240, 164)</string>
</item>
<item row="5" column="0">
<widget class="QComboBox" name="comboBox_output_coordinates">
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<property name="currentIndex">
<number>2</number>
</property>
Expand Down Expand Up @@ -687,6 +743,12 @@ color: rgb(143, 240, 164)</string>
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">border : 1px solid black;</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>GRS80</string>
Expand All @@ -709,16 +771,6 @@ color: rgb(143, 240, 164)</string>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkBox_epoch_trans">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Epoch Transformation</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand All @@ -741,7 +793,8 @@ color: rgb(143, 240, 164)</string>
<item>
<widget class="QTextBrowser" name="textBrowser_log_output">
<property name="styleSheet">
<string notr="true">background-color: rgb(31, 26, 40);</string>
<string notr="true">background-color: rgb(31, 26, 40);
border : 1px solid black;</string>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
Expand All @@ -766,13 +819,9 @@ color: rgb(143, 240, 164)</string>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>true</bool>
<string notr="true">border: 1px solid black;
text-align: center;
</string>
</property>
</widget>
</item>
Expand Down
7 changes: 1 addition & 6 deletions las_trx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from datetime import date
from os import path
from typing import TypeVar, overload, List, Mapping, Any, Optional
from typing import TypeVar, List, Mapping, Any, Optional

import pyproj.sync

Expand All @@ -13,11 +13,6 @@
logger = logging.getLogger(__name__)


@overload
def date_to_decimal_year(d: date) -> float:
...


def date_to_decimal_year(d: date) -> float:
year_part = d - date(d.year, 1, 1)
year_length = date(d.year + 1, 1, 1) - date(d.year, 1, 1)
Expand Down

0 comments on commit ddbd141

Please sign in to comment.