cfg-Datei für Preise und Arbeitszeiten Hardware wird eingelesen und überschreibt default Werte
This commit is contained in:
+50
-1
@@ -1,9 +1,31 @@
|
|||||||
import math
|
import math
|
||||||
import json
|
import json
|
||||||
import configparser
|
import configparser
|
||||||
|
import os.path
|
||||||
|
|
||||||
JSON_IDENT = 5
|
JSON_IDENT = 5
|
||||||
|
|
||||||
|
|
||||||
|
class cfg():
|
||||||
|
def __init__(self, path="Daten_cfg.txt"):
|
||||||
|
self._hasConfig = True
|
||||||
|
if os.path.exists(path):
|
||||||
|
self._cfg = configparser.ConfigParser(inline_comment_prefixes="#")
|
||||||
|
self._cfg.read_file(open(path))
|
||||||
|
else:
|
||||||
|
self._hasConfig = False
|
||||||
|
self._cfg = None
|
||||||
|
|
||||||
|
def exists(self):
|
||||||
|
return self._hasConfig
|
||||||
|
|
||||||
|
def getDictAsFloat(self, section):
|
||||||
|
res = dict()
|
||||||
|
for key, val in self._cfg.items(section):
|
||||||
|
res[key] = float(val)
|
||||||
|
return res
|
||||||
|
RieterConfig = cfg()
|
||||||
|
|
||||||
class MG():
|
class MG():
|
||||||
def __init__(self, deckblatt:dict, **kwargs):
|
def __init__(self, deckblatt:dict, **kwargs):
|
||||||
"""
|
"""
|
||||||
@@ -1445,6 +1467,9 @@ class HW():
|
|||||||
"profinetkabel": 42, # 726001xxx
|
"profinetkabel": 42, # 726001xxx
|
||||||
"schnittstellen_8x1mm2_30m": 35.4, # 725000019
|
"schnittstellen_8x1mm2_30m": 35.4, # 725000019
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if RieterConfig.exists():
|
||||||
|
ep.update(RieterConfig.getDictAsFloat("HW_Einzelpreise"))
|
||||||
# Zeit pro Einheit in min
|
# Zeit pro Einheit in min
|
||||||
zpe_dienstl_hardwareplanung = {
|
zpe_dienstl_hardwareplanung = {
|
||||||
"schaltschrankgehaeuse_b1x1200_zubehoer": 4200,
|
"schaltschrankgehaeuse_b1x1200_zubehoer": 4200,
|
||||||
@@ -1486,6 +1511,9 @@ class HW():
|
|||||||
"busverteiler_6_rsm_direct":600,
|
"busverteiler_6_rsm_direct":600,
|
||||||
"busverteiler_8_rsm_direct":960
|
"busverteiler_8_rsm_direct":960
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if RieterConfig.exists():
|
||||||
|
zpe_dienstl_hardwareplanung.update(RieterConfig.getDictAsFloat("HW_Zeiten Hardwareplanung"))
|
||||||
zpe_e_werkstatt = {
|
zpe_e_werkstatt = {
|
||||||
"schaltschrankgehaeuse_b1x1200_zubehoer": 2400,
|
"schaltschrankgehaeuse_b1x1200_zubehoer": 2400,
|
||||||
"schaltschrankgehaeuse_b2x800_zubehoer": 4800,
|
"schaltschrankgehaeuse_b2x800_zubehoer": 4800,
|
||||||
@@ -1545,6 +1573,9 @@ class HW():
|
|||||||
"drucktaster_automatische_umfahrung":15,
|
"drucktaster_automatische_umfahrung":15,
|
||||||
"halter_fuer_drucktaster":0,
|
"halter_fuer_drucktaster":0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if RieterConfig.exists():
|
||||||
|
zpe_e_werkstatt.update(RieterConfig.getDictAsFloat("HW_Zeiten Elektro-Werkstatt"))
|
||||||
Keys_of_Vor_Ort = [
|
Keys_of_Vor_Ort = [
|
||||||
"movimot_fu_mit_anschaltung",
|
"movimot_fu_mit_anschaltung",
|
||||||
"sensor_optisch_traverse",
|
"sensor_optisch_traverse",
|
||||||
@@ -2331,6 +2362,9 @@ class EMO():
|
|||||||
"Weiche_Stopper_anschliessen": 0.35, #(h/St)
|
"Weiche_Stopper_anschliessen": 0.35, #(h/St)
|
||||||
"Erdung": 0.5, #(h)
|
"Erdung": 0.5, #(h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if RieterConfig.exists():
|
||||||
|
montagezeiten.update(RieterConfig.getDictAsFloat("Elektro-Montagezeiten"))
|
||||||
def __init__(self, ea: type[EA], hw: type[HW], mg: type[MG]):
|
def __init__(self, ea: type[EA], hw: type[HW], mg: type[MG]):
|
||||||
#für jede Zeile (Eintrag im dict 'mengen') muss ein Wert übergeben werden, der aus den Klassen HW(), MG() oder EA() stammt
|
#für jede Zeile (Eintrag im dict 'mengen') muss ein Wert übergeben werden, der aus den Klassen HW(), MG() oder EA() stammt
|
||||||
self._mehraufwand = 0.1
|
self._mehraufwand = 0.1
|
||||||
@@ -2414,7 +2448,11 @@ class EMO():
|
|||||||
def dauer_emo_h_incl_mehrauwand(self):
|
def dauer_emo_h_incl_mehrauwand(self):
|
||||||
return (self.dauer_emo_h() * (1 + self._mehraufwand))
|
return (self.dauer_emo_h() * (1 + self._mehraufwand))
|
||||||
|
|
||||||
class Anschlussl():
|
class Anschlussl():
|
||||||
|
"""
|
||||||
|
Errechnung der notwendigen Anschlussleistung der Anlage.
|
||||||
|
Generelle Information, wird jedoch nicht zur Preisbestimmung verwendet.
|
||||||
|
"""
|
||||||
antrieb_cos_phi = {
|
antrieb_cos_phi = {
|
||||||
0.09:0.77,
|
0.09:0.77,
|
||||||
0.12:0.77,
|
0.12:0.77,
|
||||||
@@ -2424,6 +2462,9 @@ class Anschlussl():
|
|||||||
0.75:0.73,
|
0.75:0.73,
|
||||||
1.1:0.81
|
1.1:0.81
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if RieterConfig.exists():
|
||||||
|
antrieb_cos_phi.update(RieterConfig.getDictAsFloat("cos phi"))
|
||||||
antrieb_strom = {
|
antrieb_strom = {
|
||||||
0.09:0.4,
|
0.09:0.4,
|
||||||
0.12:0.55,
|
0.12:0.55,
|
||||||
@@ -2433,6 +2474,9 @@ class Anschlussl():
|
|||||||
0.75:1.75,
|
0.75:1.75,
|
||||||
1.1:2.55
|
1.1:2.55
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if RieterConfig.exists():
|
||||||
|
antrieb_strom.update(RieterConfig.getDictAsFloat("Antriebsstrom"))
|
||||||
mengen = {
|
mengen = {
|
||||||
#auskommentiert, was später berechnet wird
|
#auskommentiert, was später berechnet wird
|
||||||
#"Anschlussspannung":400, #Volt
|
#"Anschlussspannung":400, #Volt
|
||||||
@@ -2501,6 +2545,7 @@ class Anschlussl():
|
|||||||
if PS > 1 or PS < 0:
|
if PS > 1 or PS < 0:
|
||||||
raise Exception("Falsche Spanne")
|
raise Exception("Falsche Spanne")
|
||||||
self._Res_Faktor = PS
|
self._Res_Faktor = PS
|
||||||
|
|
||||||
class Ergebnis():
|
class Ergebnis():
|
||||||
preis_kostenart_h = {
|
preis_kostenart_h = {
|
||||||
"E_Werkstatt": 32,
|
"E_Werkstatt": 32,
|
||||||
@@ -2522,6 +2567,9 @@ class Ergebnis():
|
|||||||
"PC_Anlagenbetreuung": 60,
|
"PC_Anlagenbetreuung": 60,
|
||||||
"Anlagenbetreuung_durch_Montage": 36
|
"Anlagenbetreuung_durch_Montage": 36
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if RieterConfig.exists():
|
||||||
|
preis_kostenart_h.update(RieterConfig.getDictAsFloat("Kosten pro h"))
|
||||||
eingaben_h = {
|
eingaben_h = {
|
||||||
"Pflichtenheft":0,
|
"Pflichtenheft":0,
|
||||||
"SPS_Programmierung":150,
|
"SPS_Programmierung":150,
|
||||||
@@ -2640,3 +2688,4 @@ class Ergebnis():
|
|||||||
|
|
||||||
summary.update({"GESAMT": round(self.get_sum_of_costs(hw), 2)})
|
summary.update({"GESAMT": round(self.get_sum_of_costs(hw), 2)})
|
||||||
return summary
|
return summary
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user