Ticket #9726: 0001-libmythtv-Unicable-SCR-DIN-EN-50494.patch
File 0001-libmythtv-Unicable-SCR-DIN-EN-50494.patch, 23.3 KB (added by , 15 years ago) |
---|
-
mythtv/libs/libmythtv/diseqc.cpp
From e784aabca97756d87a159ae943c493b78cd1f4de Mon Sep 17 00:00:00 2001 From: Matthias Benesch <twoof7@freenet.de> Date: Tue, 12 Apr 2011 23:16:09 +0200 Subject: [PATCH] libmythtv: Unicable / SCR / DIN EN 50494 Add support for Unicable / Satellite Channel Router / DIN EN 50494 standard. --- mythtv/libs/libmythtv/diseqc.cpp | 194 ++++++++++++++++++++++++++---- mythtv/libs/libmythtv/diseqc.h | 55 +++++++-- mythtv/libs/libmythtv/diseqcsettings.cpp | 168 +++++++++++++++++++++++++- mythtv/libs/libmythtv/diseqcsettings.h | 8 ++ 4 files changed, 392 insertions(+), 33 deletions(-) diff --git a/mythtv/libs/libmythtv/diseqc.cpp b/mythtv/libs/libmythtv/diseqc.cpp index 7446a8f..83e180c 100644
a b 68 68 #define DISEQC_CMD_WRITE_N0 0x38 69 69 #define DISEQC_CMD_WRITE_N1 0x39 70 70 #define DISEQC_CMD_WRITE_FREQ 0x58 71 #define DISEQC_CMD_ODU 0x5A 72 #define DISEQC_CMD_ODU_MDU 0x5C 71 73 #define DISEQC_CMD_HALT 0x60 72 74 #define DISEQC_CMD_LMT_OFF 0x63 73 75 #define DISEQC_CMD_LMT_E 0x66 … … void DiSEqCDevRotor::RotationComplete(void) const 2066 2068 * \brief LNB Class. 2067 2069 */ 2068 2070 2069 const DiSEqCDevDevice::TypeTable DiSEqCDevLNB::LNBTypeTable[ 5] =2071 const DiSEqCDevDevice::TypeTable DiSEqCDevLNB::LNBTypeTable[6] = 2070 2072 { 2071 2073 { "fixed", kTypeFixed }, 2072 2074 { "voltage", kTypeVoltageControl }, 2073 2075 { "voltage_tone", kTypeVoltageAndToneControl }, 2074 2076 { "bandstacked", kTypeBandstacked }, 2077 { "scr", kTypeSCR }, 2075 2078 { QString::null, kTypeVoltageAndToneControl }, 2076 2079 }; 2077 2080 2081 const DiSEqCDevDevice::TypeTable DiSEqCDevLNB::SCRPositionTable[3] = 2082 { 2083 { "A", kTypeScrPosA }, 2084 { "B", kTypeScrPosB }, 2085 { QString::null, kTypeScrPosA }, 2086 }; 2087 2078 2088 DiSEqCDevLNB::DiSEqCDevLNB(DiSEqCDevTree &tree, uint devid) 2079 : DiSEqCDevDevice(tree, devid), 2080 m_type(kTypeVoltageAndToneControl), m_lof_switch(11700000), 2081 m_lof_hi(10600000), m_lof_lo(9750000), 2082 m_pol_inv(false) 2089 : DiSEqCDevDevice(tree, devid) 2090 , m_type(kTypeVoltageAndToneControl) 2091 , m_lof_switch(11700000) 2092 , m_lof_hi(10600000) 2093 , m_lof_lo(9750000) 2094 , m_pol_inv(false) 2095 , m_scr_userband(0) 2096 , m_scr_frequency(1400) 2097 , m_scr_position(kTypeScrPosA) 2098 , m_scr_pin(-1) 2083 2099 { 2084 2100 Reset(); 2085 2101 } … … bool DiSEqCDevLNB::Execute(const DiSEqCDevSettings&, const DTVMultiplex &tuning) 2090 2106 if (m_type == kTypeVoltageAndToneControl) 2091 2107 m_tree.SetTone(IsHighBand(tuning)); 2092 2108 2109 if (m_type == kTypeSCR) 2110 return ExecuteSCR(tuning); 2111 2093 2112 return true; 2094 2113 } 2095 2114 … … uint DiSEqCDevLNB::GetVoltage(const DiSEqCDevSettings&, 2103 2122 { 2104 2123 voltage = (IsHorizontal(tuning) ? SEC_VOLTAGE_18 : SEC_VOLTAGE_13); 2105 2124 } 2125 else if (kTypeSCR == m_type) 2126 { 2127 voltage = SEC_VOLTAGE_13; 2128 } 2106 2129 2107 2130 return voltage; 2108 2131 } … … bool DiSEqCDevLNB::Load(void) 2114 2137 query.prepare( 2115 2138 "SELECT subtype, lnb_lof_switch, " 2116 2139 " lnb_lof_hi, lnb_lof_lo, " 2117 " lnb_pol_inv, cmd_repeat " 2140 " lnb_pol_inv, cmd_repeat, " 2141 " scr_userband, scr_frequency, " 2142 " scr_position, scr_pin " 2118 2143 "FROM diseqc_tree " 2119 2144 "WHERE diseqcid = :DEVID"); 2120 2145 query.bindValue(":DEVID", GetDeviceID()); … … bool DiSEqCDevLNB::Load(void) 2126 2151 } 2127 2152 else if (query.next()) 2128 2153 { 2129 m_type = LNBTypeFromString(query.value(0).toString()); 2130 m_lof_switch = query.value(1).toInt(); 2131 m_lof_hi = query.value(2).toInt(); 2132 m_lof_lo = query.value(3).toInt(); 2133 m_pol_inv = query.value(4).toUInt(); 2134 m_repeat = query.value(5).toUInt(); 2154 m_type = LNBTypeFromString(query.value(0).toString()); 2155 m_lof_switch = query.value(1).toInt(); 2156 m_lof_hi = query.value(2).toInt(); 2157 m_lof_lo = query.value(3).toInt(); 2158 m_pol_inv = query.value(4).toUInt(); 2159 m_repeat = query.value(5).toUInt(); 2160 m_scr_userband = query.value(6).toUInt(); 2161 m_scr_frequency = query.value(7).toUInt(); 2162 m_scr_position = SCRPositionFromString(query.value(8).toString()); 2163 m_scr_pin = query.value(9).toInt(); 2135 2164 } 2136 2165 2137 2166 return true; … … bool DiSEqCDevLNB::Store(void) const 2156 2185 " lnb_lof_lo = :LOFLO, " 2157 2186 " lnb_lof_hi = :LOFHI, " 2158 2187 " lnb_pol_inv = :POLINV, " 2159 " cmd_repeat = :REPEAT " 2188 " cmd_repeat = :REPEAT, " 2189 " scr_userband = :USERBAND, " 2190 " scr_frequency = :FREQUENCY, " 2191 " scr_position = :POSITION, " 2192 " scr_pin = :PIN " 2160 2193 "WHERE diseqcid = :DEVID"); 2161 2194 query.bindValue(":DEVID", GetDeviceID()); 2162 2195 } … … bool DiSEqCDevLNB::Store(void) const 2167 2200 " ( parentid, ordinal, type, " 2168 2201 " description, subtype, lnb_lof_switch, " 2169 2202 " lnb_lof_lo, lnb_lof_hi, lnb_pol_inv, " 2170 " cmd_repeat ) " 2203 " cmd_repeat, scr_userband, scr_frequency, " 2204 " scr_position, scr_pin) " 2171 2205 "VALUES " 2172 2206 " (:PARENT, :ORDINAL, 'lnb', " 2173 2207 " :DESC, :TYPE, :LOFSW, " 2174 2208 " :LOFLO, :LOFHI, :POLINV, " 2175 " :REPEAT ) "); 2209 " :REPEAT, :USERBAND, :FREQUENCY," 2210 " :POSITION, :PIN ) "); 2176 2211 } 2177 2212 2178 2213 if (m_parent) 2179 2214 query.bindValue(":PARENT", m_parent->GetDeviceID()); 2180 2215 2181 query.bindValue(":ORDINAL", m_ordinal); 2182 query.bindValue(":DESC", GetDescription()); 2183 query.bindValue(":TYPE", type); 2184 query.bindValue(":LOFSW", m_lof_switch); 2185 query.bindValue(":LOFLO", m_lof_lo); 2186 query.bindValue(":LOFHI", m_lof_hi); 2187 query.bindValue(":POLINV", m_pol_inv); 2188 query.bindValue(":REPEAT", m_repeat); 2216 query.bindValue(":ORDINAL", m_ordinal); 2217 query.bindValue(":DESC", GetDescription()); 2218 query.bindValue(":TYPE", type); 2219 query.bindValue(":LOFSW", m_lof_switch); 2220 query.bindValue(":LOFLO", m_lof_lo); 2221 query.bindValue(":LOFHI", m_lof_hi); 2222 query.bindValue(":POLINV", m_pol_inv); 2223 query.bindValue(":REPEAT", m_repeat); 2224 query.bindValue(":USERBAND", m_scr_userband); 2225 query.bindValue(":FREQUENCY", m_scr_frequency); 2226 query.bindValue(":POSITION", SCRPositionToString(m_scr_position)); 2227 query.bindValue(":PIN", m_scr_pin); 2189 2228 2190 2229 // update dev_id 2191 2230 if (!query.exec()) … … bool DiSEqCDevLNB::IsHighBand(const DTVMultiplex &tuning) const 2211 2250 { 2212 2251 switch (m_type) 2213 2252 { 2253 case kTypeSCR: 2214 2254 case kTypeVoltageAndToneControl: 2215 2255 return (tuning.frequency > m_lof_switch); 2216 2256 case kTypeBandstacked: … … bool DiSEqCDevLNB::IsHorizontal(const DTVMultiplex &tuning) const 2244 2284 uint32_t DiSEqCDevLNB::GetIntermediateFrequency( 2245 2285 const DiSEqCDevSettings&, const DTVMultiplex &tuning) const 2246 2286 { 2287 uint32_t frequency = GetFrequency(tuning); 2288 2289 if (m_type == kTypeSCR) 2290 { 2291 uint t = (frequency / 1000 + m_scr_frequency + 2) / 4 - 350; 2292 frequency = ((t + 350) * 4) * 1000 - frequency; 2293 } 2294 2295 return frequency; 2296 } 2297 2298 uint32_t DiSEqCDevLNB::GetFrequency(const DTVMultiplex& tuning) const 2299 { 2247 2300 (void) tuning; 2248 2301 2249 2302 uint64_t abs_freq = tuning.frequency; … … uint32_t DiSEqCDevLNB::GetIntermediateFrequency( 2251 2304 2252 2305 return (lof > abs_freq) ? (lof - abs_freq) : (abs_freq - lof); 2253 2306 } 2307 2308 bool DiSEqCDevLNB::ExecuteSCR(const DTVMultiplex &tuning) const 2309 { 2310 VERBOSE(VB_CHANNEL, LOC + QString("SCR: Tuning to %1kHz, %2, %3 using UB=%4, FREQ=%5MHz, POS=%6%7") 2311 .arg(tuning.frequency) 2312 .arg(IsHighBand(tuning) ? "HiBand" : "LoBand") 2313 .arg(IsHorizontal(tuning) ? "H" : "V") 2314 .arg(m_scr_userband) 2315 .arg(m_scr_frequency) 2316 .arg((m_scr_position == kTypeScrPosA) ? "A" : "B") 2317 .arg((m_scr_pin >= 0 && m_scr_pin <= 255) ? QString(", PIN=%1").arg(m_scr_pin) : QString(""))); 2318 2319 if (m_scr_userband > 7) 2320 { 2321 VERBOSE(VB_IMPORTANT, LOC_ERR + "SCR: Userband ID configuration out of range!"); 2322 return false; 2323 } 2324 2325 uint32_t frequency = GetFrequency(tuning); 2326 uint t = (frequency / 1000 + m_scr_frequency + 2) / 4 - 350; 2327 if (t >= 1024) 2328 { 2329 VERBOSE(VB_IMPORTANT, LOC_ERR + "SCR: T out of range!"); 2330 return false; 2331 } 2332 2333 // build command 2334 unsigned char data[3]; 2335 data[0] = t >> 8 | m_scr_userband << 5; 2336 data[1] = t & 0x00FF; 2337 2338 if (IsHighBand(tuning)) 2339 data[0] |= (1 << 2); 2340 2341 if (IsHorizontal(tuning)) 2342 data[0] |= (1 << 3); 2343 2344 if (m_scr_position == kTypeScrPosB) 2345 data[0] |= (1 << 4); 2346 2347 // send command 2348 if (m_scr_pin >= 0 && m_scr_pin <= 255) 2349 { 2350 data[2] = m_scr_pin; 2351 return SendSCRCommand(DISEQC_CMD_ODU_MDU, 3, data); 2352 } else { 2353 return SendSCRCommand(DISEQC_CMD_ODU, 2, data); 2354 } 2355 } 2356 2357 bool DiSEqCDevLNB::PowerOffSCR() const 2358 { 2359 VERBOSE(VB_CHANNEL, LOC + QString("SCR: Power off UB=%1%7") 2360 .arg(m_scr_userband) 2361 .arg((m_scr_pin >= 0 && m_scr_pin <= 255) 2362 ? QString(", PIN=%1").arg(m_scr_pin) 2363 : QString(""))); 2364 2365 if (m_scr_userband > 7) 2366 { 2367 VERBOSE(VB_IMPORTANT, LOC_ERR + "SCR: Userband ID configuration out of range!"); 2368 return false; 2369 } 2370 2371 // build command 2372 unsigned char data[3]; 2373 data[0] = (uint8_t) (m_scr_userband << 5); 2374 data[1] = 0x00; 2375 2376 // send command 2377 if (m_scr_pin >= 0 && m_scr_pin <= 255) 2378 { 2379 data[2] = m_scr_pin; 2380 return SendSCRCommand(DISEQC_CMD_ODU_MDU, 3, data); 2381 } else { 2382 return SendSCRCommand(DISEQC_CMD_ODU, 2, data); 2383 } 2384 } 2385 2386 bool DiSEqCDevLNB::SendSCRCommand(uint cmd, uint data_len, unsigned char *data) const 2387 { 2388 // power on bus 2389 if (!m_tree.SetVoltage(SEC_VOLTAGE_18)) 2390 return false; 2391 usleep(DISEQC_SHORT_WAIT); 2392 2393 // send command 2394 bool ret = m_tree.SendCommand(DISEQC_ADR_SW_ALL, cmd, 1, data_len, data); 2395 2396 // power off bus 2397 if (!m_tree.SetVoltage(SEC_VOLTAGE_13)) 2398 return false; 2399 2400 return ret; 2401 } -
mythtv/libs/libmythtv/diseqc.h
diff --git a/mythtv/libs/libmythtv/diseqc.h b/mythtv/libs/libmythtv/diseqc.h index 643dcc8..f418dfd 100644
a b class DiSEqCDevDevice 142 142 virtual bool Store(void) const = 0; 143 143 144 144 // Sets 145 enum dvbdev_t { kTypeSwitch = 0, kTypeRotor = 1, kTypeLNB = 2, }; 145 enum dvbdev_t 146 { 147 kTypeSwitch = 0, 148 kTypeRotor = 1, 149 kTypeLNB = 2, 150 }; 146 151 void SetDeviceType(dvbdev_t type) { m_dev_type = type; } 147 152 void SetParent(DiSEqCDevDevice* parent) { m_parent = parent; } 148 153 void SetOrdinal(uint ordinal) { m_ordinal = ordinal; } … … class DiSEqCDevLNB : public DiSEqCDevDevice 376 381 kTypeVoltageControl = 1, 377 382 kTypeVoltageAndToneControl = 2, 378 383 kTypeBandstacked = 3, 384 kTypeSCR = 4, 379 385 }; 380 void SetType(dvbdev_lnb_t type) { m_type = type; } 381 void SetLOFSwitch(uint lof_switch) { m_lof_switch = lof_switch; } 382 void SetLOFHigh( uint lof_hi) { m_lof_hi = lof_hi; } 383 void SetLOFLow( uint lof_lo) { m_lof_lo = lof_lo; } 384 void SetPolarityInverted(bool inv) { m_pol_inv = inv; } 386 enum dvbdev_pos_t 387 { 388 kTypeScrPosA = 0, 389 kTypeScrPosB = 1, 390 }; 391 void SetType(dvbdev_lnb_t type) { m_type = type; } 392 void SetLOFSwitch(uint lof_switch) { m_lof_switch = lof_switch; } 393 void SetLOFHigh( uint lof_hi) { m_lof_hi = lof_hi; } 394 void SetLOFLow( uint lof_lo) { m_lof_lo = lof_lo; } 395 void SetPolarityInverted(bool inv) { m_pol_inv = inv; } 396 void SetUserBand(uint userband) { m_scr_userband = userband; } 397 void SetFrequency(uint freq) { m_scr_frequency = freq; } 398 void SetPosition(dvbdev_pos_t pos) { m_scr_position = pos; } 399 void SetPIN(int pin) { m_scr_pin = pin; } 385 400 386 401 // Gets 387 402 dvbdev_lnb_t GetType(void) const { return m_type; } … … class DiSEqCDevLNB : public DiSEqCDevDevice 389 404 uint GetLOFHigh(void) const { return m_lof_hi; } 390 405 uint GetLOFLow(void) const { return m_lof_lo; } 391 406 bool IsPolarityInverted(void) const { return m_pol_inv; } 407 uint GetUserBand(void) const { return m_scr_userband; } 408 uint GetFrequency(void) const { return m_scr_frequency; } 409 dvbdev_pos_t GetPosition(void) const { return m_scr_position; } 410 int GetPIN(void) const { return m_scr_pin; } 411 392 412 bool IsHighBand(const DTVMultiplex&) const; 393 413 bool IsHorizontal(const DTVMultiplex&) const; 394 414 uint32_t GetIntermediateFrequency(const DiSEqCDevSettings&, … … class DiSEqCDevLNB : public DiSEqCDevDevice 403 423 static dvbdev_lnb_t LNBTypeFromString(const QString &type) 404 424 { return (dvbdev_lnb_t) TableFromString(type, LNBTypeTable); } 405 425 426 static QString SCRPositionToString(dvbdev_pos_t pos) 427 { return TableToString((uint)pos, SCRPositionTable); } 428 429 static dvbdev_pos_t SCRPositionFromString(const QString &pos) 430 { return (dvbdev_pos_t) TableFromString(pos, SCRPositionTable); } 431 432 protected: 433 uint32_t GetFrequency(const DTVMultiplex&) const; 434 bool ExecuteSCR(const DTVMultiplex&) const; 435 bool PowerOffSCR() const; 436 bool SendSCRCommand(uint cmd, uint data_len = 0, 437 unsigned char *data = NULL) const; 438 406 439 private: 407 440 dvbdev_lnb_t m_type; 408 441 uint m_lof_switch; … … class DiSEqCDevLNB : public DiSEqCDevDevice 412 445 /// on each reflection, so antenna systems with an even number 413 446 /// of reflectors will need to set this value. 414 447 bool m_pol_inv; 415 416 static const TypeTable LNBTypeTable[5]; 448 /// Satellite channel router (SCR) 449 uint m_scr_userband; /* 0-7 */ 450 uint m_scr_frequency; 451 dvbdev_pos_t m_scr_position; /* A|B */ 452 int m_scr_pin; /* 0-255, -1=disabled */ 453 454 static const TypeTable LNBTypeTable[6]; 455 static const TypeTable SCRPositionTable[3]; 417 456 }; 418 457 419 458 #endif // _DISEQC_H_ -
mythtv/libs/libmythtv/diseqcsettings.cpp
diff --git a/mythtv/libs/libmythtv/diseqcsettings.cpp b/mythtv/libs/libmythtv/diseqcsettings.cpp index f01b857..32d5046 100644
a b class LNBTypeSetting : public ComboBoxSetting, public Storage 668 668 kTypeVoltageAndToneControl)); 669 669 addSelection(DeviceTree::tr("Bandstacked"), 670 670 QString::number((uint) DiSEqCDevLNB::kTypeBandstacked)); 671 addSelection(DeviceTree::tr("Unicable / SCR"), 672 QString::number((uint) DiSEqCDevLNB::kTypeSCR)); 671 673 } 672 674 673 675 virtual void Load(void) … … class LNBPolarityInvertedSetting : public CheckBoxSetting, public Storage 809 811 DiSEqCDevLNB &m_lnb; 810 812 }; 811 813 814 //////////////////////////////////////// LNBSCRUserBandSetting 815 816 class LNBSCRUserBandSetting : public SpinBoxSetting, public Storage 817 { 818 public: 819 LNBSCRUserBandSetting(DiSEqCDevLNB &lnb) : 820 SpinBoxSetting(this, 0, 7, 1), m_lnb(lnb) 821 { 822 setLabel(DeviceTree::tr("SCR ID")); 823 QString help = DeviceTree::tr( 824 "Unicable / SCR userband ID (0-7)"); 825 setHelpText(help); 826 } 827 828 virtual void Load(void) 829 { 830 setValue(m_lnb.GetUserBand()); 831 } 832 833 virtual void Save(void) 834 { 835 m_lnb.SetUserBand(intValue()); 836 } 837 838 virtual void Save(QString /*destination*/) { } 839 840 private: 841 DiSEqCDevLNB &m_lnb; 842 }; 843 844 //////////////////////////////////////// LNBSCRFrequencySetting 845 846 class LNBSCRFrequencySetting : public LineEditSetting, public Storage 847 { 848 public: 849 LNBSCRFrequencySetting(DiSEqCDevLNB &lnb) : LineEditSetting(this), m_lnb(lnb) 850 { 851 setLabel(DeviceTree::tr("SCR frequency (MHz)")); 852 QString help = DeviceTree::tr( 853 "Unicable / SCR userband frequency (950 - 2150MHz)"); 854 setHelpText(help); 855 } 856 857 virtual void Load(void) 858 { 859 setValue(QString::number(m_lnb.GetFrequency())); 860 } 861 862 virtual void Save(void) 863 { 864 m_lnb.SetFrequency(getValue().toUInt()); 865 } 866 867 virtual void Save(QString /*destination*/) { } 868 869 private: 870 DiSEqCDevLNB &m_lnb; 871 }; 872 873 //////////////////////////////////////// LNBSCRPositionSetting 874 875 class LNBSCRPositionSetting : public ComboBoxSetting, public Storage 876 { 877 public: 878 LNBSCRPositionSetting(DiSEqCDevLNB &lnb) : ComboBoxSetting(this), m_lnb(lnb) 879 { 880 setLabel(DeviceTree::tr("SCR Position")); 881 QString help = DeviceTree::tr( 882 "Unicable / SCR userband satellite position (A/B)"); 883 setHelpText(help); 884 addSelection(DiSEqCDevLNB::SCRPositionToString(DiSEqCDevLNB::kTypeScrPosA), 885 QString::number((uint) DiSEqCDevLNB::kTypeScrPosA)); 886 addSelection(DiSEqCDevLNB::SCRPositionToString(DiSEqCDevLNB::kTypeScrPosB), 887 QString::number((uint) DiSEqCDevLNB::kTypeScrPosB)); 888 } 889 890 virtual void Load(void) 891 { 892 setValue(getValueIndex(QString::number((uint)m_lnb.GetPosition()))); 893 } 894 895 virtual void Save(void) 896 { 897 m_lnb.SetPosition((DiSEqCDevLNB::dvbdev_pos_t)getValue().toUInt()); 898 } 899 900 virtual void Save(QString /*destination*/) { } 901 902 private: 903 DiSEqCDevLNB &m_lnb; 904 }; 905 906 //////////////////////////////////////// LNBSCRPINSetting 907 908 class LNBSCRPINSetting : public LineEditSetting, public Storage 909 { 910 public: 911 LNBSCRPINSetting(DiSEqCDevLNB &lnb) : LineEditSetting(this), m_lnb(lnb) 912 { 913 setLabel(DeviceTree::tr("SCR PIN code")); 914 QString help = DeviceTree::tr( 915 "Unicable / SCR PIN code (-1 disabled, 0 - 255)"); 916 setHelpText(help); 917 } 918 919 virtual void Load(void) 920 { 921 setValue(QString::number(m_lnb.GetPIN())); 922 } 923 924 virtual void Save(void) 925 { 926 m_lnb.SetPIN(getValue().toInt()); 927 } 928 929 virtual void Save(QString /*destination*/) { } 930 931 private: 932 DiSEqCDevLNB &m_lnb; 933 }; 934 812 935 //////////////////////////////////////// LNBConfig 813 936 814 937 LNBConfig::LNBConfig(DiSEqCDevLNB &lnb) … … LNBConfig::LNBConfig(DiSEqCDevLNB &lnb) 830 953 group->addChild(m_lof_hi); 831 954 m_pol_inv = new LNBPolarityInvertedSetting(lnb); 832 955 group->addChild(m_pol_inv); 956 m_scr_ub = new LNBSCRUserBandSetting(lnb); 957 group->addChild(m_scr_ub); 958 m_scr_freq = new LNBSCRFrequencySetting(lnb); 959 group->addChild(m_scr_freq); 960 m_scr_pos = new LNBSCRPositionSetting(lnb); 961 group->addChild(m_scr_pos); 962 m_scr_pin = new LNBSCRPINSetting(lnb); 963 group->addChild(m_scr_pin); 964 833 965 connect(m_type, SIGNAL(valueChanged(const QString&)), 834 966 this, SLOT( UpdateType( void))); 835 967 connect(preset, SIGNAL(valueChanged(const QString&)), … … void LNBConfig::SetPreset(const QString &value) 862 994 m_lof_hi->setEnabled(false); 863 995 m_lof_lo->setEnabled(false); 864 996 m_pol_inv->setEnabled(false); 997 m_scr_ub->setEnabled(false); 998 m_scr_freq->setEnabled(false); 999 m_scr_pos->setEnabled(false); 1000 m_scr_pin->setEnabled(false); 865 1001 } 866 1002 } 867 1003 … … void LNBConfig::UpdateType(void) 878 1014 m_lof_hi->setEnabled(false); 879 1015 m_lof_lo->setEnabled(true); 880 1016 m_pol_inv->setEnabled(true); 1017 m_scr_ub->setEnabled(false); 1018 m_scr_freq->setEnabled(false); 1019 m_scr_pos->setEnabled(false); 1020 m_scr_pin->setEnabled(false); 881 1021 break; 882 1022 case DiSEqCDevLNB::kTypeVoltageAndToneControl: 883 1023 m_lof_switch->setEnabled(true); 884 1024 m_lof_hi->setEnabled(true); 885 1025 m_lof_lo->setEnabled(true); 886 1026 m_pol_inv->setEnabled(true); 1027 m_scr_ub->setEnabled(false); 1028 m_scr_freq->setEnabled(false); 1029 m_scr_pos->setEnabled(false); 1030 m_scr_pin->setEnabled(false); 887 1031 break; 888 1032 case DiSEqCDevLNB::kTypeBandstacked: 889 1033 m_lof_switch->setEnabled(false); 890 1034 m_lof_hi->setEnabled(true); 891 1035 m_lof_lo->setEnabled(true); 892 1036 m_pol_inv->setEnabled(true); 1037 m_scr_ub->setEnabled(false); 1038 m_scr_freq->setEnabled(false); 1039 m_scr_pos->setEnabled(false); 1040 m_scr_pin->setEnabled(false); 1041 break; 1042 case DiSEqCDevLNB::kTypeSCR: 1043 m_lof_switch->setEnabled(true); 1044 m_lof_hi->setEnabled(true); 1045 m_lof_lo->setEnabled(true); 1046 m_pol_inv->setEnabled(true); 1047 m_scr_ub->setEnabled(true); 1048 m_scr_freq->setEnabled(true); 1049 m_scr_pos->setEnabled(true); 1050 m_scr_pin->setEnabled(true); 893 1051 break; 894 1052 } 895 1053 } … … bool convert_diseqc_db(void) 1397 1555 1398 1556 MSqlQuery iquery(MSqlQuery::InitCon()); 1399 1557 iquery.prepare( 1400 "SELECT cardinputid, diseqc_port, diseqc_pos, " 1401 " lnb_lof_switch, lnb_lof_hi, lnb_lof_lo " 1558 "SELECT cardinputid, diseqc_port, diseqc_pos, " 1559 " lnb_lof_switch, lnb_lof_hi, lnb_lof_lo, " 1560 " scr_userband, scr_frequency, scr_position," 1561 " scr_pin " 1402 1562 "FROM cardinput " 1403 1563 "WHERE cardinput.cardid = :CARDID"); 1404 1564 … … bool convert_diseqc_db(void) 1628 1788 lnb->SetLOFSwitch(iquery.value(3).toUInt()); 1629 1789 lnb->SetLOFHigh(iquery.value(4).toUInt()); 1630 1790 lnb->SetLOFLow(iquery.value(5).toUInt()); 1791 lnb->SetUserBand(iquery.value(6).toUInt()); 1792 lnb->SetFrequency(iquery.value(7).toUInt()); 1793 lnb->SetPosition(DiSEqCDevLNB::SCRPositionFromString(iquery.value(8).toString())); 1794 lnb->SetPIN(iquery.value(9).toInt()); 1631 1795 } 1632 1796 1633 1797 // save settings -
mythtv/libs/libmythtv/diseqcsettings.h
diff --git a/mythtv/libs/libmythtv/diseqcsettings.h b/mythtv/libs/libmythtv/diseqcsettings.h index de78a71..973efea 100644
a b class LNBLOFSwitchSetting; 78 78 class LNBLOFLowSetting; 79 79 class LNBLOFHighSetting; 80 80 class LNBPolarityInvertedSetting; 81 class LNBSCRUserBandSetting; 82 class LNBSCRFrequencySetting; 83 class LNBSCRPositionSetting; 84 class LNBSCRPINSetting; 81 85 82 86 class LNBConfig : public QObject, public ConfigurationWizard 83 87 { … … class LNBConfig : public QObject, public ConfigurationWizard 96 100 LNBLOFLowSetting *m_lof_lo; 97 101 LNBLOFHighSetting *m_lof_hi; 98 102 LNBPolarityInvertedSetting *m_pol_inv; 103 LNBSCRUserBandSetting *m_scr_ub; 104 LNBSCRFrequencySetting *m_scr_freq; 105 LNBSCRPositionSetting *m_scr_pos; 106 LNBSCRPINSetting *m_scr_pin; 99 107 }; 100 108 101 109 class DeviceTree : public ListBoxSetting, public Storage