Quantities

This commit is contained in:
Wir
2024-11-04 15:23:49 +01:00
parent 8aa2d1d383
commit 0472eb4cfb

View File

@@ -5,9 +5,6 @@
"execution_count": null,
"id": "f512fba3-877f-411e-935c-0c878d478b2d",
"metadata": {
"jupyter": {
"source_hidden": true
},
"scrolled": true
},
"outputs": [],
@@ -104,11 +101,7 @@
"cell_type": "code",
"execution_count": null,
"id": "a993570d-dea2-4bd6-80c0-b36297ce6a3a",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"metadata": {},
"outputs": [],
"source": [
"#Beispiel\n",
@@ -123,14 +116,62 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "3a33ffb1-afe7-44b5-863b-9779a95a2a9c",
"metadata": {
"jupyter": {
"source_hidden": true
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"PlantName: W-Raps Helmacker Plant 24/25\n",
"Maintenance:\n",
"name: Scheibeneggen Helmacker Maintenance 24/25\n",
"timestamp: 28.07.24 11:34 \n",
"equipment: Scheibenegge Catros\n",
"quant_type: quantity--price\n",
"quant_measure: time\n",
"quant_value: 2\n",
"quant_inventory_adjustment: None\n",
"Seeding:\n",
"name: W-Raps Otello KWS Helmacker Seeding 24/25\n",
"timestamp: 22.08.24 22:00 \n",
"equipment: Sähmaschine Cataya\n",
"plant loc: Helmacker\n",
"quant_type: quantity--standard\n",
"quant_measure: weight\n",
"quant_value: 50\n",
"quant_inventory_adjustment: decrement\n",
"Input:\n",
"name: Innovert Raps Input 24/25\n",
"timestamp: 12.10.24 13:18 \n",
"equipment: Spritze\n",
"quant_type: quantity--standard\n",
"quant_measure: volume\n",
"quant_value: 10\n",
"quant_inventory_adjustment: decrement\n",
"Input:\n",
"name: Innovert Raps Input 24/25\n",
"timestamp: 03.11.24 23:00 \n",
"equipment: Spritze\n",
"quant_type: quantity--standard\n",
"quant_measure: volume\n",
"quant_value: 10\n",
"quant_inventory_adjustment: decrement\n",
"Medical:\n",
"name: Schneckenkorn Medical 24/25\n",
"timestamp: 30.08.24 06:42 \n",
"equipment: Schneckenkornstreuer Leinfelder\n",
"Harvest:\n",
"name: W-Raps Helmacker Harvest 24/25\n",
"timestamp: 20.10.24 10:11 \n",
"equipment: Mähdrescher Leinfelder\n",
"Sale:\n",
"name: W-Raps Sale 24/25\n",
"timestamp: 28.10.24 07:54 \n"
]
}
},
"outputs": [],
],
"source": [
"# alle logs von einem Plant\n",
"import neofarm.lib as neo\n",
@@ -150,6 +191,15 @@
" print(f\"timestamp: {formatted_date}\") \n",
" print(f\"equipment: {log.equipment[0].name}\")\n",
"\n",
" input=neo.Log.Maintenance.from_id(log.id)\n",
" print(f\"quant_type: {input.quantities[0].type}\")\n",
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
" print(f\"quant_value: {input.quantities[0].value}\")\n",
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
" #print(f\"quant_value: {input.quantities[0].unit_price.decimal}\")\n",
"\n",
" \t\n",
" \n",
" logs = asset.get_logs_of_type(neo.Log.Seeding)\n",
" for log in logs:\n",
" print(\"Seeding:\")\n",
@@ -159,14 +209,33 @@
" print(f\"equipment: {log.equipment[0].name}\")\n",
" print(f\"plant loc: {log.location[0].name}\")\n",
"\n",
" input=neo.Log.Seeding.from_id(log.id)\n",
" print(f\"quant_type: {input.quantities[0].type}\")\n",
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
" print(f\"quant_value: {input.quantities[0].value}\")\n",
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
" \t\n",
"\n",
" \n",
" logs = asset.get_logs_of_type(neo.Log.Input)\n",
" for log in logs:\n",
" print(\"Input:\")\n",
" print(f\"name: {log.name}\")\n",
" #print(f\"name: {log.id}\")\n",
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
" print(f\"timestamp: {formatted_date}\")\n",
" print(f\"equipment: {log.equipment[0].name}\")\n",
"\n",
"\n",
"\n",
"\n",
" input=neo.Log.Input.from_id(log.id)\n",
" print(f\"quant_type: {input.quantities[0].type}\")\n",
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
" print(f\"quant_value: {input.quantities[0].value}\")\n",
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
"\n",
" \n",
" logs = asset.get_logs_of_type(neo.Log.Medical)\n",
" for log in logs:\n",
" print(\"Medical:\")\n",
@@ -193,136 +262,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "ce30a9db-735e-4174-ad56-0f0079ab04c6",
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true,
"source_hidden": true
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"PlantName: W-Raps Helmacker Plant 24/25\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>LogType</th>\n",
" <th>Name</th>\n",
" <th>Timestamp</th>\n",
" <th>Equipment</th>\n",
" <th>Location</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Maintenance</td>\n",
" <td>Scheibeneggen Helmacker Maintenance 24/25</td>\n",
" <td>28.07.24 11:34</td>\n",
" <td>Scheibenegge Catros</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Seeding</td>\n",
" <td>W-Raps Otello KWS Helmacker Seeding 24/25</td>\n",
" <td>22.08.24 22:00</td>\n",
" <td>Sähmaschine Cataya</td>\n",
" <td>Helmacker</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Input</td>\n",
" <td>Innovert Raps Input 24/25</td>\n",
" <td>12.10.24 13:18</td>\n",
" <td>Spritze</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Input</td>\n",
" <td>Innovert Raps Input 24/25</td>\n",
" <td>03.11.24 23:00</td>\n",
" <td>Spritze</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Medical</td>\n",
" <td>Schneckenkorn Medical 24/25</td>\n",
" <td>30.08.24 06:42</td>\n",
" <td>Schneckenkornstreuer Leinfelder</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Harvest</td>\n",
" <td>W-Raps Helmacker Harvest 24/25</td>\n",
" <td>20.10.24 10:11</td>\n",
" <td>Mähdrescher Leinfelder</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Sale</td>\n",
" <td>W-Raps Sale 24/25</td>\n",
" <td>28.10.24 07:54</td>\n",
" <td></td>\n",
" <td></td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" LogType Name Timestamp \\\n",
"0 Maintenance Scheibeneggen Helmacker Maintenance 24/25 28.07.24 11:34 \n",
"1 Seeding W-Raps Otello KWS Helmacker Seeding 24/25 22.08.24 22:00 \n",
"2 Input Innovert Raps Input 24/25 12.10.24 13:18 \n",
"3 Input Innovert Raps Input 24/25 03.11.24 23:00 \n",
"4 Medical Schneckenkorn Medical 24/25 30.08.24 06:42 \n",
"5 Harvest W-Raps Helmacker Harvest 24/25 20.10.24 10:11 \n",
"6 Sale W-Raps Sale 24/25 28.10.24 07:54 \n",
"\n",
" Equipment Location \n",
"0 Scheibenegge Catros \n",
"1 Sähmaschine Cataya Helmacker \n",
"2 Spritze \n",
"3 Spritze \n",
"4 Schneckenkornstreuer Leinfelder \n",
"5 Mähdrescher Leinfelder \n",
"6 "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"#alle logs von einem Plant in Tabelle\n",
"import neofarm.lib as neo\n",
@@ -370,7 +313,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "1b5e32c3-d543-4449-b311-c7e373d99296",
"id": "649e4d8e-c3a9-4d5f-9bdf-9427f416fca9",
"metadata": {},
"outputs": [],
"source": []