SL: Add reach SL edition window.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-07-24 11:36:08 +02:00
1 parent e9b00aa148
commit 5a29dca452
10 files changed
+379 -16

No files matched your search

+14
View File
@@ -34,6 +34,7 @@ class Profile(object):
self._kp = float(kp)
self._name = str(name)
self._reach = reach
self._sl = None
self._points: List[Point] = []
@@ -120,6 +121,19 @@ class Profile(object):
self._name = value.strip()
self._status.modified()
@property
def sl(self):
"""
Returns:
Profile sediment layers.
"""
return self._sl
@sl.setter
def sl(self, value: str):
self._sl = value
self._status.modified()
@property
def profile_type(self):
"""
+4 -1
View File
@@ -108,7 +108,7 @@ class Layer(SQLSubModel):
"sedimentary_layer_layer(id, ind, name, type, height, sl) "+
"VALUES (" +
f"{self.id}, {ind}, '{self._sql_format(self._name)}', " +
f"'{self._sql_format(self._type)}', '{self._height}', {sl}" +
f"'{self._sql_format(self._type)}', '{self._height}', {sl.id}" +
")"
)
execute(sql)
@@ -135,6 +135,9 @@ class SedimentLayer(SQLSubModel):
else:
self.id = id
def __str__(self):
return f"{self.name} ({len(self)}) - {self.comment}"
def __len__(self):
return len(self._layers)
@@ -46,6 +46,10 @@ class SedimentLayerList(SQLSubModel):
return ok
@property
def sediment_layers(self):
return self._sl.copy()
def get(self, index):
return self._sl[index]