Behebung von diversen Fehlern
Begin mit IOs
This commit is contained in:
parent
e2ba5ff1d6
commit
1dea051cbf
@ -6,6 +6,7 @@ import android.view.MenuItem;
|
||||
import android.view.Menu;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.aped.communication.IIO;
|
||||
import com.example.aped.communication.IXML;
|
||||
import com.example.aped.communication.TestXML;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
@ -24,6 +25,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
private AppBarConfiguration mAppBarConfiguration;
|
||||
/** zur Verwendung von xml anstatt der direkten Einbindung.*/
|
||||
private IXML xml;
|
||||
/** zur Verwendung von uebergabe anstatt der direkten Einbindung.*/
|
||||
private IIO uebergabe;
|
||||
/** allgemeines.*/
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
@ -75,13 +78,16 @@ public class MainActivity extends AppCompatActivity {
|
||||
Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
case R.id.action_download_xml:
|
||||
if (xml.download() == 0) {
|
||||
Toast.makeText(this, "Download .xml",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return true;
|
||||
case R.id.action_upload_xml:
|
||||
if (xml.upload() == 0) {
|
||||
Toast.makeText(this, "Upload .xml",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
xml.upload();
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.example.aped.communication;
|
||||
|
||||
public interface IIO {
|
||||
/**
|
||||
*
|
||||
* @return Einlesewerte in Array
|
||||
*/
|
||||
String[][] rueckgabeAI();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Einlesewerte in Array
|
||||
*/
|
||||
String rueckgabeDI();
|
||||
//DO (int);
|
||||
}
|
@ -1,9 +1,16 @@
|
||||
package com.example.aped.communication;
|
||||
|
||||
public interface IXML {
|
||||
/** dowload er XML.*/
|
||||
/**
|
||||
*
|
||||
* @return hat Funktioniert?
|
||||
*/
|
||||
int download();
|
||||
/** upload er XML.*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @return hat Funktioniert?
|
||||
*/
|
||||
int upload();
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
package com.example.aped.communication;
|
||||
|
||||
public class TestIO implements IIO {
|
||||
/** Test Klasse.*/
|
||||
@Override
|
||||
public String[][] rueckgabeAI() {
|
||||
//String AI[3][3];
|
||||
/** AI[0][0]="Test";
|
||||
AI[1][1]="5.658";
|
||||
AI[1][2]="Volt";
|
||||
|
||||
AI[1][0]="Test2";
|
||||
AI[1][1]="10";
|
||||
AI[1][2]="Ohm";
|
||||
|
||||
AI[2][0]="Test3";
|
||||
AI[2][1]="9.88";
|
||||
AI[2][2]="Ampere";
|
||||
|
||||
AI[3][0]="END";*/
|
||||
return AI;
|
||||
}
|
||||
/** Test Klasse.*/
|
||||
@Override
|
||||
public String rueckgabeDI() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
package com.example.aped.communication;
|
||||
|
||||
|
||||
public class TestXML implements IXML {
|
||||
/** was soll bei download getan werden.*/
|
||||
/** Test Klasse.*/
|
||||
@Override
|
||||
public int download() {
|
||||
return 0;
|
||||
}
|
||||
/** was soll bei upload getan werden.*/
|
||||
/** Test Klasse.*/
|
||||
@Override
|
||||
public int upload() {
|
||||
return 0;
|
||||
|
@ -17,6 +17,14 @@ import com.example.aped.R;
|
||||
public class AllIOsFragment extends Fragment {
|
||||
/**Azeige Modell.*/
|
||||
private AllIOsViewModel allIOsViewModel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param inflater
|
||||
* @param container
|
||||
* @param savedInstanceState
|
||||
* @return root
|
||||
*/
|
||||
public View onCreateView(final @NonNull LayoutInflater inflater,
|
||||
final ViewGroup container,
|
||||
final Bundle savedInstanceState) {
|
||||
|
@ -13,7 +13,11 @@ public class AllIOsViewModel extends ViewModel {
|
||||
mText.setValue("Anzeige aller Mess & Sollwertvorgaben bestimmt durch"
|
||||
+ " die xml");
|
||||
}
|
||||
/** Rückgabe des Textes.*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @return mText
|
||||
*/
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
|
@ -17,7 +17,15 @@ import com.example.aped.R;
|
||||
public class YourIOsFragment extends Fragment {
|
||||
/**Azeige Modell.*/
|
||||
private YourIOsViewModel yourIOsViewModel;
|
||||
public View onCreateView(final @NonNull LayoutInflater inflater,
|
||||
|
||||
/**
|
||||
*
|
||||
* @param inflater
|
||||
* @param container
|
||||
* @param savedInstanceState
|
||||
* @return root
|
||||
*/
|
||||
public View onCreateView(final @NonNull LayoutInflater inflater,
|
||||
final ViewGroup container,
|
||||
final Bundle savedInstanceState) {
|
||||
yourIOsViewModel =
|
||||
|
@ -12,7 +12,11 @@ public class YourIOsViewModel extends ViewModel {
|
||||
mText = new MutableLiveData<>();
|
||||
mText.setValue("Personalisierte Anzeige der Mess- & Sollwerte");
|
||||
}
|
||||
/** Rückgabe des Textes.*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @return test Rückgabe
|
||||
*/
|
||||
public final LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="red">#ff0006</color>
|
||||
<color name="red">#f01313</color>
|
||||
<color name="grey">#5a5458</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
|
Loading…
x
Reference in New Issue
Block a user