This repository has been archived by the owner on Jan 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ThorsCrafter/build-2.3
Version 2.3
- Loading branch information
Showing
20 changed files
with
913 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*.buildpath | ||
turbineControl_v2/.metadata/.lock | ||
*.log | ||
turbineControl_v2/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version | ||
*.tree | ||
turbineControl_v2/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources | ||
*.prefs | ||
turbineControl_v2/.metadata/.plugins/org.eclipse.dltk.core/Containers.dat | ||
*.xml | ||
turbineControl_v2/.metadata/version.ini | ||
*.version | ||
turbineControl_v2/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi | ||
*.project |
24 changes: 22 additions & 2 deletions
24
turbineControl_v2/src/changelog.txt → ...eControl_v2/src/changelog/changelogDE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 21 additions & 2 deletions
23
turbineControl_v2/src/changelogEn.txt → ...eControl_v2/src/changelog/changelogEn.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
-- Input API -- | ||
-- von Thor_s_Crafter -- | ||
-- Version 1.0 -- | ||
|
||
--Formatiert grosse Zahlenwerte in String (z.B. 1.000) | ||
function formatNumber(value) | ||
--Werte kleiner 1000 muessen nicht formatiert werden | ||
if value < 1000 then return value end | ||
|
||
--Legt Berechnungsvariablen fest | ||
local array = {} | ||
local vStr = tostring(value) | ||
local len = string.len(vStr) | ||
local modulo = math.fmod(len,3) | ||
|
||
--Speichert einzelne Ziffern in einem Array ab | ||
for i=1,len do array[i] = string.sub(vStr,i,i) end | ||
|
||
--Legt (max. 2) Ziffern am Anfang in ein extra Array und entfernt | ||
--Diese aus dem alten Array | ||
local array2 = {} | ||
if modulo ~= 0 then | ||
for i=1,modulo do | ||
array2[i] = array[i] | ||
table.remove(array,i) | ||
end | ||
end | ||
|
||
--Fuegt die Punkte als Feld im ersten Array ein | ||
for i=1,#array+1,4 do | ||
table.insert(array,i,".") | ||
end | ||
|
||
--Fuegt beide Arrays zusammen | ||
for i=#array2,1,-1 do table.insert(array,1,array2[i]) end | ||
if modulo == 0 then table.remove(array,1) end --Entfernt ggf. Punkt am Anfang | ||
|
||
--Wandelt alles in einen String zurueck und gibt diesen zurueck | ||
local final = "" | ||
for k,v in pairs(array) do final = final..v end | ||
return final | ||
end | ||
|
||
--Wartet darauf das "Enter" gedrueckt wird | ||
function getEnter() | ||
term.write("Enter druecken...") | ||
while true do | ||
local event,keyCode = os.pullEvent("key") | ||
if keyCode == 28 then | ||
print() | ||
break | ||
end | ||
end | ||
end | ||
|
||
function formatNumberComma(value) | ||
--Werte kleiner 1000 muessen nicht formatiert werden | ||
if value < 1000 then return value end | ||
|
||
--Legt Berechnungsvariablen fest | ||
local array = {} | ||
local vStr = tostring(value) | ||
local len = string.len(vStr) | ||
local modulo = math.fmod(len,3) | ||
|
||
--Speichert einzelne Ziffern in einem Array ab | ||
for i=1,len do array[i] = string.sub(vStr,i,i) end | ||
|
||
--Legt (max. 2) Ziffern am Anfang in ein extra Array und entfernt | ||
--Diese aus dem alten Array | ||
local array2 = {} | ||
if modulo ~= 0 then | ||
for i=1,modulo do | ||
array2[i] = array[i] | ||
table.remove(array,i) | ||
end | ||
end | ||
|
||
--Fuegt die Punkte als Feld im ersten Array ein | ||
for i=1,#array+1,4 do | ||
table.insert(array,i,",") | ||
end | ||
|
||
--Fuegt beide Arrays zusammen | ||
for i=#array2,1,-1 do table.insert(array,1,array2[i]) end | ||
if modulo == 0 then table.remove(array,1) end --Entfernt ggf. Punkt am Anfang | ||
|
||
--Wandelt alles in einen String zurueck und gibt diesen zurueck | ||
local final = "" | ||
for k,v in pairs(array) do final = final..v end | ||
return final | ||
end | ||
|
||
--Wartet darauf das "Enter" gedrueckt wird | ||
function getEnter() | ||
term.write("Enter druecken...") | ||
while true do | ||
local event,keyCode = os.pullEvent("key") | ||
if keyCode == 28 then | ||
print() | ||
break | ||
end | ||
end | ||
end | ||
|
||
--Gibt true oder false zurueck - Anfrage an den Anwender | ||
function yesNoInput(message) | ||
local input = "" | ||
while true do | ||
print(message.." (j/n)?") | ||
term.write("Eingabe: ") | ||
input = read() | ||
if input == "j" then return true | ||
elseif input == "n" then return false | ||
end | ||
end | ||
end | ||
|
||
--Gibt einen String zurueck - Anfrage an den Anwender | ||
function stringInput(message) | ||
print(message) | ||
term.write("Eingabe: ") | ||
local input = read() | ||
return input | ||
end | ||
|
||
--Gibt eine Zahl zwischen min und max zurueck - Anfrage an den Anwender | ||
function numberInput(message,min,max) | ||
local input = "" | ||
while true do | ||
print(message.." ("..min.."-"..max..")") | ||
term.write("Eingabe: ") | ||
input = read() | ||
if tonumber(input) ~= nil then | ||
local inputNr = tonumber(input) | ||
if inputNr >= min and inputNr <= max then return inputNr end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
turbineControl_v2/src/touchpoint.lua → turbineControl_v2/src/config/touchpoint.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.