Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pin names #2135

Merged
merged 17 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ private void setWave() {
if (scienceLab.isConnected()) {
if (digital_mode == WaveConst.SQUARE) {
if (phase == WaveData.PHASE_MIN.getValue()) {
scienceLab.setW1(freq1, waveType1);
scienceLab.setW2(freq2, waveType2);
scienceLab.setSI1(freq1, waveType1);
scienceLab.setSI2(freq2, waveType2);
} else {
scienceLab.setWaves(freq1, phase, freq2);
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/io/pslab/communication/CommandsProto.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ public class CommandsProto {
public int GET_STATES = 2;


public int ID1 = 0;
public int ID2 = 1;
public int ID3 = 2;
public int ID4 = 3;
public int LA1 = 0;
public int LA2 = 1;
public int LA3 = 2;
public int LA4 = 3;
public int LMETER = 4;


Expand Down
216 changes: 108 additions & 108 deletions app/src/main/java/io/pslab/communication/ScienceLab.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class AnalogConstants {

public double[] gains = {1, 2, 4, 5, 8, 10, 16, 32, 1 / 11.};
public String[] allAnalogChannels = {"CH1", "CH2", "CH3", "MIC", "CAP", "SEN", "AN8"};
public String[] allAnalogChannels = {"CH1", "CH2", "CH3", "MIC", "CAP", "RES", "VOL"};
public String[] biPolars = {"CH1", "CH2", "CH3", "MIC"};
public Map<String, double[]> inputRanges = new HashMap<>();
public Map<String, Integer> picADCMultiplex = new HashMap<>();
Expand All @@ -22,17 +22,17 @@ public AnalogConstants() {
inputRanges.put("CH3", new double[]{-3.3, 3.3});
inputRanges.put("MIC", new double[]{-3.3, 3.3});
inputRanges.put("CAP", new double[]{0, 3.3});
inputRanges.put("SEN", new double[]{0, 3.3});
inputRanges.put("AN8", new double[]{0, 3.3});
inputRanges.put("RES", new double[]{0, 3.3});
inputRanges.put("VOL", new double[]{0, 3.3});

picADCMultiplex.put("CH1", 3);
picADCMultiplex.put("CH2", 0);
picADCMultiplex.put("CH3", 1);
picADCMultiplex.put("MIC", 2);
picADCMultiplex.put("AN4", 4);
picADCMultiplex.put("SEN", 7);
picADCMultiplex.put("RES", 7);
picADCMultiplex.put("CAP", 5);
picADCMultiplex.put("AN8", 8);
picADCMultiplex.put("VOL", 8);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class DigitalChannel {
private static final int EVERY_FOURTH_RISING_EDGE = 4;
private static final int EVERY_RISING_EDGE = 3;
private static final int EVERY_FALLING_EDGE = 2;
public static String[] digitalChannelNames = {"ID1", "ID2", "ID3", "ID4", "SEN", "EXT", "CNTR"};
public static String[] digitalChannelNames = {"LA1", "LA2", "LA3", "LA4", "RES", "EXT", "FRQ"};
public String channelName, dataType;
public int initialStateOverride, channelNumber, length, prescalar, trigger, dlength, plotLength, maxTime, mode;
public double xAxis[], yAxis[], timestamps[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

final String[] ranges = {"+/-16V", "+/-8V", "+/-4V", "+/-3V", "+/-2V",
"+/-1" + DataFormatter.decSeparator + "5V", "+/-1V", "+/-500mV", "+/-160V"};
final String[] channels = {"CH1", "CH2", "CH3", "MIC", "CAP", "SEN", "AN8"};
final String[] channels = {"CH1", "CH2", "CH3", "MIC", "CAP", "RES", "VOL"};
final String[] mics = {"MICROPHONE", "IN-BUILT MIC"};

spinnerRangeCh1 = v.findViewById(R.id.spinner_range_ch1_cp);
Expand Down
24 changes: 12 additions & 12 deletions app/src/main/java/io/pslab/fragment/ControlFragmentAdvanced.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,22 +304,22 @@ public void onFocusChange(View v, boolean hasFocus) {
@Override
public void onClick(View v) {
try {
Double frequencyW1 = Double.parseDouble(etWidgetControlAdvanced1.getText().toString());
Double frequencyW2 = Double.parseDouble(etWidgetControlAdvanced2.getText().toString());
Double frequencySI1 = Double.parseDouble(etWidgetControlAdvanced1.getText().toString());
Double frequencySI2 = Double.parseDouble(etWidgetControlAdvanced2.getText().toString());
float phase = Float.parseFloat(etWidgetControlAdvanced3.getText().toString());

String wavetypeW1 = spinnerControlAdvanced1.getSelectedItem().toString();
String wavetypeW2 = spinnerControlAdvanced2.getSelectedItem().toString();
String wavetypeSI1 = spinnerControlAdvanced1.getSelectedItem().toString();
String wavetypeSI2 = spinnerControlAdvanced2.getSelectedItem().toString();

if ("SINE".equals(wavetypeW1) && scienceLab.isConnected())
scienceLab.setSine1(frequencyW1);
else if ("SQUARE".equals(wavetypeW1) && scienceLab.isConnected())
scienceLab.setSqr1(frequencyW1, -1, false);
if ("SINE".equals(wavetypeSI1) && scienceLab.isConnected())
scienceLab.setSine1(frequencySI1);
else if ("SQUARE".equals(wavetypeSI1) && scienceLab.isConnected())
scienceLab.setSqr1(frequencySI1, -1, false);

if ("SINE".equals(wavetypeW2) && scienceLab.isConnected())
scienceLab.setSine2(frequencyW2);
else if ("SQUARE".equals(wavetypeW2) && scienceLab.isConnected())
scienceLab.setSqr2(frequencyW2, -1);
if ("SINE".equals(wavetypeSI2) && scienceLab.isConnected())
scienceLab.setSine2(frequencySI2);
else if ("SQUARE".equals(wavetypeSI2) && scienceLab.isConnected())
scienceLab.setSqr2(frequencySI2, -1);
} catch (NumberFormatException e) {
etWidgetControlAdvanced1.setText("0");
etWidgetControlAdvanced2.setText("0");
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/io/pslab/fragment/ControlFragmentRead.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ public void onClick(View view) {
tvControlRead5.setText(DataFormatter.formatDouble(scienceLab.getVoltage("CH1", 1), DataFormatter.LOW_PRECISION_FORMAT));
tvControlRead6.setText(DataFormatter.formatDouble(scienceLab.getVoltage("CAP", 1), DataFormatter.LOW_PRECISION_FORMAT));
tvControlRead7.setText(DataFormatter.formatDouble(scienceLab.getVoltage("CH2", 1), DataFormatter.LOW_PRECISION_FORMAT));
tvControlRead8.setText(DataFormatter.formatDouble(scienceLab.getVoltage("SEN", 1), DataFormatter.LOW_PRECISION_FORMAT));
tvControlRead8.setText(DataFormatter.formatDouble(scienceLab.getVoltage("RES", 1), DataFormatter.LOW_PRECISION_FORMAT));
tvControlRead9.setText(DataFormatter.formatDouble(scienceLab.getVoltage("CH3", 1), DataFormatter.LOW_PRECISION_FORMAT));
tvControlRead10.setText(DataFormatter.formatDouble(scienceLab.getVoltage("AN8", 1), DataFormatter.LOW_PRECISION_FORMAT));
tvControlRead10.setText(DataFormatter.formatDouble(scienceLab.getVoltage("VOL", 1), DataFormatter.LOW_PRECISION_FORMAT));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public class LALogicLinesFragment extends Fragment {
private ArrayList<String> recordXAxis;
private ArrayList<String> recordYAxis;
private ArrayList<Integer> recordChannelMode;
private String[] channels = new String[]{"ID1", "ID2", "ID3", "ID4"};
private String[] channels = new String[]{"LA1", "LA2", "LA3", "LA4"};
private HashMap<String, Integer> channelMap;
private ArrayList<Spinner> channelSelectSpinners;
private ArrayList<Spinner> edgeSelectSpinners;
Expand Down
48 changes: 24 additions & 24 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
<string-array name="multimeter_knob_states">
<item>CH1</item>
<item>CAP</item>
<item>AN8</item>
<item>VOL</item>
<item>RES</item>
<item>C</item>
<item>ID1</item>
<item>ID2</item>
<item>ID3</item>
<item>ID4</item>
<item>LA1</item>
<item>LA2</item>
<item>LA3</item>
<item>LA4</item>
<item>CH3</item>
<item>CH2</item>
</string-array>
Expand All @@ -85,7 +85,7 @@
<item>CH3</item>
<item>MIC</item>
<item>CAP</item>
<item>AN8</item>
<item>VOL</item>
<item>RES</item>
<item>C</item>
<item>LA1</item>
Expand Down Expand Up @@ -172,10 +172,10 @@
<string name="file_created_success_message">تم تكوين ملف التكوين بنجاح</string>
<string name="file_created_fail_message">فشل إنشاء ملف التكوين</string>

<string name="id1">ID1</string>
<string name="id2">ID2</string>
<string name="id3">ID3</string>
<string name="id4">ID4</string>
<string name="id1">LA1</string>
<string name="id2">LA2</string>
<string name="id3">LA3</string>
<string name="id4">LA4</string>
<string name="count_pulse">عدد النبض</string>
<string name="capacitance_unit">الفاراد وحدة السعة الكهربائية</string>
<string name="frequency_unit">هرتز</string>
Expand Down Expand Up @@ -203,10 +203,10 @@
<string name="frequency">تكرر</string>
<string name="count_pulses">عد البقول</string>
<string-array name="ID">
<item>ID1</item>
<item>ID2</item>
<item>ID3</item>
<item>ID4</item>
<item>LA1</item>
<item>LA2</item>
<item>LA3</item>
<item>LA4</item>
</string-array>
<string name="reset">إعادة تعيين</string>
<string name="voltage">الجهد االكهربى</string>
Expand All @@ -215,7 +215,7 @@
<string name="ch3">CH3</string>
<string name="cap">الرأس</string>
<string name="sen">ITS</string>
<string name="an8">AN8</string>
<string name="an8">VOL</string>
<string name="w1">الموجة 1</string>
<string name="w2">موجة 2</string>
<string name="phase">مرحلة</string>
Expand Down Expand Up @@ -579,10 +579,10 @@
</string-array>

<string-array name="channel_choices">
<item>ID1</item>
<item>ID2</item>
<item>ID3</item>
<item>ID4</item>
<item>LA1</item>
<item>LA2</item>
<item>LA3</item>
<item>LA4</item>
</string-array>

<string name="no_data_generated">لا توجد بيانات</string>
Expand All @@ -603,11 +603,11 @@
<string name="multimeter_dialog_heading">المقياس المتعدد</string>
<string name="multimeter_default_value">0.00</string>
<string name="multimeter_configurations">تكوينات متعدد المتر</string>
<string name="multimeter_dialog_text">استخدم PV1 ، PV2 ، PV3 قم بتوصيل دبابيس SEN و CAP بالمقاوم والمكثف على التوالي كما هو موضح في الشكل لقياس مقاومة أو سعة العنصر المتصل. \ n \ n \ u2022 CH1 و CH2 يمكن قراءة مجموعة خالية من الجهد. يمكن قراءة CH3 ، SEN ، CAP ، AN8 فقط من 0V إلى 3.30V</string>
<string name="multimeter_dialog_description">\ u2022 لقياس الجهد ، قم بتوصيل مصدر الطاقة مباشرة (مثل PV1 و PV2 و PV3) بدبابيس القناة كما هو موضح في الشكل. \ n \ n \ u2022 على نحو مشابه لقياس التردد أو نبضة العد ، قم بتوصيل SQ1 أو SQ2 أو SQ3 أو SQ4 دبابيس إلى ID1 أو ID2 أو ID3 أو ID4. \ n \ n<b>Different Sections</b>\n\n
<b>Resistance:</b> Measures the resistance of the element connected between the SEN and GND pin of the PSLab device.\n\n
<string name="multimeter_dialog_text">استخدم PV1 ، PV2 ، PV3 قم بتوصيل دبابيس RES و CAP بالمقاوم والمكثف على التوالي كما هو موضح في الشكل لقياس مقاومة أو سعة العنصر المتصل. \ n \ n \ u2022 CH1 و CH2 يمكن قراءة مجموعة خالية من الجهد. يمكن قراءة CH3 ، RES ، CAP ، VOL فقط من 0V إلى 3.30V</string>
<string name="multimeter_dialog_description">\ u2022 لقياس الجهد ، قم بتوصيل مصدر الطاقة مباشرة (مثل PV1 و PV2 و PV3) بدبابيس القناة كما هو موضح في الشكل. \ n \ n \ u2022 على نحو مشابه لقياس التردد أو نبضة العد ، قم بتوصيل SQ1 أو SQ2 أو SQ3 أو SQ4 دبابيس إلى LA1 أو LA2 أو LA3 أو LA4. \ n \ n<b>Different Sections</b>\n\n
<b>Resistance:</b> Measures the resistance of the element connected between the RES and GND pin of the PSLab device.\n\n
<b>Capacitance:</b> Measures the capacitance of the element connected between the CAP and GND pin of the PSLab device.\n\n
<b>Voltage:</b> Measures the voltage of any elements connect connected between any of the channel and GND pins and other pins such as AN8.\n\n
<b>Voltage:</b> Measures the voltage of any elements connect connected between any of the channel and GND pins and other pins such as VOL.\n\n
<b>Frequency:</b> Measures the frequency across any element connected between any of ID and GND pins.\n\n
<b>Count Pulse:</b> Measures the pulse of any wave through an element connected between any of ID and GND pins.\n\n
</string>
Expand All @@ -618,7 +618,7 @@
<string name="powersource_dialog_description">\ u2022 قم بتوصيل سلك واحد بـ PV1 وسلك آخر بـ GND لإنشاء فولتات بين 5 فولت إلى -5 فولت. \ n \ n         \ u2022 بالمثل قم بتوصيل الأسلاك بين PV2 لإنشاء الفولتية بين 3.3V إلى -3.3V \ n \ n         \ u2022 استخدم دبوس PV3 لإنشاء الفولتية بين 0V إلى 3.3V \ n \ n         \ u2022 PCS pin يستخدم لتوفير تيار ثابت بين دبوس PCS ودبوس GND في نطاق 3.3mA</string>

<string name="logic_analyzer_dialog_text">المنطق محلل هو أداة تستخدم لمعرفة العلاقة الزمنية بين النبضات الرقمية المختلفة. يمكن تشغيل Logic Analyzer المتاح في تطبيق PSLab على النحو التالي: \ n</string>
<string name="logic_analyzer_dialog_description">\ n \ u2022 تتمثل الخطوة الأولى في توصيل النبضات الرقمية المنتجة للمصدر / المرسِل بدبوس / قياسات القياس ، مثل ID1 و ID2 و ID3 و / أو ID4. \ n \ n \ u2022 كما هو موضح في الشكل ، دبابيس الموجات المربعة SQR1 ، يمكن استخدام SQR2 و SQR3 و / أو SQR4 في حالة عدم توفر مصدر آخر لتوليد نبضات رقمية. \ n \ n \ u2022 الخطوة التالية هي تحديد وضع القناة أي عدد دبابيس IDx المستخدمة. \ n \ n \ u2022 الخطوة الأخيرة هي اختيار مجموعة القنوات والحواف المناسبة (التي تحتاج إلى تحليل) من القائمة المتوفرة لكل دبوس قيد الاستخدام. \ n \ n \ u2022 الآن اضغط على الزر "تحليل" وانتظر حتى يتم جلب البيانات من جهاز. بمجرد جلب البيانات ، سيتم رسم البيانات لتحليلها.</string>
<string name="logic_analyzer_dialog_description">\ n \ u2022 تتمثل الخطوة الأولى في توصيل النبضات الرقمية المنتجة للمصدر / المرسِل بدبوس / قياسات القياس ، مثل LA1 و LA2 و LA3 و / أو LA4. \ n \ n \ u2022 كما هو موضح في الشكل ، دبابيس الموجات المربعة SQR1 ، يمكن استخدام SQR2 و SQR3 و / أو SQR4 في حالة عدم توفر مصدر آخر لتوليد نبضات رقمية. \ n \ n \ u2022 الخطوة التالية هي تحديد وضع القناة أي عدد دبابيس IDx المستخدمة. \ n \ n \ u2022 الخطوة الأخيرة هي اختيار مجموعة القنوات والحواف المناسبة (التي تحتاج إلى تحليل) من القائمة المتوفرة لكل دبوس قيد الاستخدام. \ n \ n \ u2022 الآن اضغط على الزر "تحليل" وانتظر حتى يتم جلب البيانات من جهاز. بمجرد جلب البيانات ، سيتم رسم البيانات لتحليلها.</string>

<string name="wave_name_holder">ثلاثي</string>
<string name="freq_text">تكرر :</string>
Expand Down
Loading